Pandoc: YAML metadata incorrectly interpreted when Markdown dialect is specified

Created on 30 Mar 2016  Â·  7Comments  Â·  Source: jgm/pandoc

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).

Most helpful comment

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

All 7 comments

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. https://github.com/jgm/pandoc/issues/2827

That does the trick. Thanks for your prompt reply!

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

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.

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

Thank you for the clarification!

I am so glad I found this issue. )

Was this page helpful?
0 / 5 - 0 ratings