YAML Metadata blocks: passing CSS variables to HTML without switching off the smart extension? #9992
Unanswered
PlainMartin
asked this question in
Q&A
Replies: 1 comment
-
Anything in YAML metadata gets parsed as Markdown, so yes, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using metadata fields in Markdown files to pass CSS attributes (e.g. colors) to an HTML template.
This will work with color names or hex values, but CSS custom properties / variables such as
var(--color-red)
will be converted tovar(–color-red)
(two hyphens converted to an n-dash) and not recognized anymore by the browser.With
--from=markdown-smart
, the variable names are left untouched.On the other hand, it would be nice to keep the smart extension on for, well, everything else.
So: Is there a way to pass variables such as
var(--color-red)
to an HTML template without switching off Pandoc’s smart extension?Thank you.
Beta Was this translation helpful? Give feedback.
All reactions