Open mfisher87 opened 10 months ago
Thanks for the report!
Some notes about the current context as I looked quickly to confirm something. Just leaving that here for future us.
Internally, we use --metadata-file
to pass all the merged metadata. String scalars are parsed as Markdown, but using default extension only as we use a custom markdown reader internally. The relevant part in the doc:
--metadata-file=FILE Read metadata from the supplied YAML (or JSON) file. This option can be used with every input format, but string scalars in the metadata file will always be parsed as Markdown. (If the input format is Markdown or a Markdown variant, then the same variant will be used to parse the metadata file; if it is a non-Markdown format, pandoc’s default Markdown extensions will be used.)
So currently, I think there is a limitation where YAML field can only use markdown syntax supported by default Markdown format. +emoji
is not part of the default; so it is not parsed as such when provided in YAML.
It is when provided in non-yaml part because correctly controls how the body part is read with pandoc.read()
Interesting one! Thanks again for the report.
Any time! Thank you for the awesome work, all :heart:
Workaround (for some cases): use HTML entitles rather than emoji. For example:
---
title: "things are ♥"
---
renders the heart.
Pasting unicode characters directly in to the Markdown file is also working great for me as a workaround!
---
title: "things are ❤️"
---
Some more detail: Emoji shortcodes in title
key of a document's front-matter render in the nav-bar, but do not render in the document itself.
_quarto.yml
:
<...>
navbar:
left:
- about.md
<...>
format:
html:
from: "markdown+emoji"
about.md
:
---
title: ":question: About"
---
Foo
This issue hinges on which parts of the YAML metadata get interpreted as Markdown vs not.
We can't interpret all metadata as Markdown. That is a source of the "reverse" bugs, notably URLs parsed as Markdown are a bad thing. I've written more about this in a related upstream Pandoc issue.
Bug description
When
from: "markdown+emoji"
is set, emoji shortcodes work in Markdown except their behavior in front-matter is inconsistent.A page with front-matter:
will display the emoji successfully on a listing page which includes this page:
But not on the page itself:
Steps to reproduce
_quarto.yml
::heart:
in its front-matter, e.g. title or subtitle.Expected behavior
Emoji shortcodes render consistently (either they do or they don't) from YAML front-matter regardless of where the content is rendered.
Actual behavior
Emoji shortcodes in YAML front-matter do render in some context, but not in other contexts. See repro instructions :)
Your environment
Quarto check output
Also reproduced with 1.4.510