-
-
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
Undocumented change in YAML metadata parsing (Pandoc 2.2.3) #4819
Comments
running the Linux binaries under Debian Stretch |
In Pandoc 2.2.2 and earlier, a YAML element --- foo: 42 ... would produce a `MetaString`. Since Pandoc 2.2.3 this will result in a `MetaInlines`. (see jgm/pandoc#4819)
Another undocumented change in pandoc 2.2.3 and 2.2.3.1:
now produces
but in earlier versions this produced a
This has currently broken panzer. |
These changes weren't intentional. It appears that my changes to YAML parsing in 2.2.3, which were intended to fix one regression, caused several other ones. Clearly we need more extensive tests! Have you verified that these cases have the old behavior with version 2.2.2.1? |
Actually I don't see why '42' should be parsed as a MetaString. MetaInlines seems better and more consistent here (even though that is a change). However, we should keep parsing of 'true' as a boolean, since we actually have a boolean type constructor in MetaValue. |
I've verified the boolean case has the old behaviour with version 2.2.2.1. This version of pandoc does not generate any problems for me. I agree that '42' should be parsed as a MetaInlines. Note that under 2.2.2.1:
produces:
while:
produces:
which seems wrong...? |
so this change was introduced in 2.2.3 ... |
Well, in both cases a single number ends up as string somehow: in 2.2.2 directly as For me, both interpretations can work (although I'd vote to read/represent a number actually as a number). However, since this new behaviour does break things, it should be documented ... |
@msprev confirmed. in 2.2.2.1 2.2.3.1 yields for both YAML versions the same representation |
Since we don't have a numerical type in MetaValue (perhaps that was a mistake), we have to represent numbers as strings, so I'm going with MetaInlines. I document the change in the changelog for 2.2.3.2... |
@jgm thanks for the quick fix :) |
Pandoc 2.2.3 and 2.2.3.1 read
as
However, in pandoc 2.2.2 and earlier, the same YAML would produce a
MetaString
instead:Is this change of behaviour intended? Since it may break some Lua filters, it should be documented.
The text was updated successfully, but these errors were encountered: