jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.78k stars 3.39k forks source link

"yes" becomes "true" #10304

Open champignoom opened 1 month ago

champignoom commented 1 month ago

yes in the input becomes true in the output. According to the latest YAML spec, "yes" is no longer a boolean, and reasonably so.

$ cat test.md                
---
indenting: [medium,yes]
...

$ pandoc -t context -s test.md | grep indenting
\setupindenting[medium,true]

$ pandoc -v
pandoc 3.5
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/exp/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
jgm commented 1 month ago

We use the Haskell yaml package for parsing YAML; this is based on libyaml which I think targets an older version of the YAML spec.

jgm commented 1 month ago

HsYAML is an alternative we tried for a while, but it lacks an active maintainer and would not build reliably.

tarleb commented 3 weeks ago

Just to mention a work-around for this kind of issue: quoting the problematic value prevents it from being converted to a boolean. The following should all work:

indenting: [medium,'yes']
indenting:
  - medium
  - 'yes'
# and in this specific case:
indenting: 'medium,yes'