jgm / pandocfilters

A python module for writing pandoc filters, with a collection of examples
BSD 3-Clause "New" or "Revised" License
512 stars 111 forks source link

Improve stringfy to handle numbers in YAML header #14

Closed rgaiacs closed 9 years ago

rgaiacs commented 9 years ago

stringfy could handle strings in YAML header

$ pandoc -t json -f markdown <<EOF

---
str: foo

---
EOF
[{"unMeta":{"str":{"t":"MetaInlines","c":[{"t":"Str","c":"foo"}]}}},[]]

but could not handle numbers

$ pandoc -t json -f markdown <<EOF

---
int: 1

---
EOF
[{"unMeta":{"int":{"t":"MetaString","c":"1"}}},[]]

This small change fix this problem.

jgm commented 9 years ago

Thanks!