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

Markdown writer doesn't emit boolean false metadata values #6388

Closed
khenriks opened this issue May 21, 2020 · 1 comment
Closed

Markdown writer doesn't emit boolean false metadata values #6388

khenriks opened this issue May 21, 2020 · 1 comment

Comments

@khenriks
Copy link

I am using pandoc 2.9.2.1.

Pandoc doesn't seem to properly output boolean false values in the metadata block when writing markdown. I tested outputting the intermediate data with -t json and so verified that it's getting parsed on input, it's just not showing up in the output.

Minimal reproduction:

cat | pandoc -s -t markdown << EOF
---
nvalue: false
value: true
---

Some text
EOF

Actual output:

---
value: true
---

Some text

Expected output:

---
nvalue: false
value: true
---

Some text

Thanks!

@jgm
Copy link
Owner

jgm commented May 21, 2020

This is because we're formatting this by converting the Meta to a doctemplates Context. Doctemplates doesn't contain boolean values---it tests instead for empty values---so we have (in T.P.Writers.Shared line 110):

metaValueToVal _ _ (MetaBool True) = return $ SimpleVal "true"
metaValueToVal _ _ (MetaBool False) = return NullVal

Not sure we can do better without modifying doctemplates to add an explicit boolean type (which might make sense in any case).

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

No branches or pull requests

3 participants