mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 15:44:59 +08:00
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.
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
```
|
||||
% 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"])]})
|
||||
[]
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user