Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML metadata incorrectly interpreted when Markdown dialect is specified #2827

Closed
beatngu13 opened this issue Mar 30, 2016 · 7 comments
Closed

Comments

@beatngu13
Copy link

I usually use a YAML header to specify various variables before I transform my Markdown documents into other formats, e.g. PDF.

Since Pandoc supports GitHub Flavored Markdown, I often prefer this variant because it provides an additional set of useful features. One of this features is to automatically interpret URLs as hyperlinks.

The MWE (change the suffix to .md) attached to this issue contains a simple YAML header where I set the color for those links. Unfortunately this is only taken into account if I use CommonMark syntax and the following command line:

pandoc mwe.md --latex-engine=xelatex -o mwe.pdf

If I add --from=markdown_github the links are recognized, but they're not colored and the YAML metadata is interpreted as plain text.

I use Pandoc 1.17.0.2 on Mac OS X El Capitan (10.11.4).

@jgm
Copy link
Owner

jgm commented Mar 30, 2016

Try:

pandoc mwe.md -f markdown_github+yaml_metadata_block \
  -o mwe.pdf -Vlinkcolor=blue

+++ beatngu13 [Mar 30 16 05:54 ]:

I usually use a YAML header to specify various variables before I
transform my Markdown documents into other formats, e.g. PDF.

Since Pandoc supports [1]GitHub Flavored Markdown, I often prefer this
variant because it provides an additional set of useful features. One
of this features is to automatically interpret URLs as hyperlinks.

The [2]MWE (change the suffix to .md) attached to this issue contains a
simple YAML header where I set the color for those links. Unfortunately
this is only taken into account if I use CommonMark syntax and the
following command line:

pandoc mwe.md --latex-engine=xelatex -o mwe.pdf

If I add --from=markdown_github the links are recognized, but they're
not colored and the YAML metadata is interpreted as plain text.

I use Pandoc 1.17.0.2 on Mac OS X El Capitan (10.11.4).


You are receiving this because you are subscribed to this thread.
Reply to this email directly or [3]view it on GitHub

References

  1. https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown
  2. https://github.com/jgm/pandoc/files/195501/mwe.txt
  3. YAML metadata incorrectly interpreted when Markdown dialect is specified #2827

@beatngu13
Copy link
Author

That does the trick. Thanks for your prompt reply!

@jdhao
Copy link

jdhao commented Dec 11, 2017

-f github_markdown is deprecated. The new command should be
pandoc -f gfm -Vurlcolor=blue -o test.pdf test.md

@FilBot3
Copy link

FilBot3 commented Jul 13, 2020

So should it be:

pandoc \
  --from=gfm+yaml_metadata_block \
  --to=latex \
  --output=my_document.pdf \
  title.yml \
  my_document.md

I tried that, and it didn't seem to process it correctly.

@jgm
Copy link
Owner

jgm commented Jul 15, 2020

the yaml_metadata_block extension is not supported for gfm at this point.

@FilBot3
Copy link

FilBot3 commented Jul 15, 2020

Thank you for the clarification!

@abitrolly
Copy link

I am so glad I found this issue. )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants