-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Boolean values in metadata are printed as "true"/null in $meta-json$ #6650
Comments
Currently we render the metadata to a doctemplates Context and take the JSON from this. |
Hi, I'm really new to pandoc code: From Text.DocTemplate, I see that Browsing the code I get to
maps false to But the previous line maps:
So I went ahead and did the same with the False values. I.e.
And got the expected result both in this case and #6630 All tests passing in my repository ( Is this fix valid? |
I think the problem is that if you set it to SimpleVal "false", then template tests will pass (because they're checking for an empty value). So if you had a template with
then, if I'm not mistaken, you'd get output |
This issue is now fixed by the use of doctemplates 0.9. |
Boolean values in frontmatter, or added to the metadata by a filter, are reported in
$meta-json$
using the string"true"
for true values and JSONnull
for false values. It would be better if they were reported as JSON booleans.Demo:
Desired output from both pandoc commands is
Pandoc version information:
Possibly related to #6630 and #6388.
N.B. in addition to being a minor headache for downstream consumers of the JSON metadata, this problem confused me into thinking I had a bug in my filter, not creating a new metadata entry correctly or something like that.
The text was updated successfully, but these errors were encountered: