pandoc/test/command/4819.md
John MacFarlane b76203ccf1 Markdown reader: Properly handle boolean values in YAML metadata.
This fixes a regression in 2.2.3, which cause boolean values to
be parsed as MetaInlines instead of MetaBool.

Note also an undocumented (but desirable) change in 2.2.3:
numbers are now parsed as MetaInlines rather than MetaString.

Closes #4819.
2018-08-07 09:26:58 -07:00

641 B

% pandoc -f markdown -t native -s
---
foo: 42
...
^D
Pandoc (Meta {unMeta = fromList [("foo",MetaInlines [Str "42"])]})
[]
% pandoc -f markdown -t native -s
---
foo: true
...
^D
Pandoc (Meta {unMeta = fromList [("foo",MetaBool True)]})
[]
% pandoc -f markdown -t native -s
---
foo: True
...
^D
Pandoc (Meta {unMeta = fromList [("foo",MetaBool True)]})
[]
% pandoc -f markdown -t native -s
---
foo: FALSE
...
^D
Pandoc (Meta {unMeta = fromList [("foo",MetaBool False)]})
[]
% pandoc -f markdown -t native -s
---
foo: no
...
^D
Pandoc (Meta {unMeta = fromList [("foo",MetaInlines [Str "no"])]})
[]