Closed ickc closed 1 year ago
It seems that this can be reproduced without this filter by setting
---
bibliography: bug.yml
nocite: |
@*
...
or by running
pandoc --metadata-file=bug.yml <<< 'test'
The problem seems to be the hypen-minus after the block marker: replacing |-
with |
resolves this. See https://github.com/jgm/pandoc/issues/8449 for a related issue and some more details.
I'm trying to figure out if this is a pandoc or YAML parser bug; valid YAML should never produce an error.
Here's an even smaller test:
pandoc -s -t native
---
abstract: |-
a
b
...
^D
Pandoc
Meta { unMeta = fromList [] }
[ HorizontalRule
, Para
[ Str "abstract:" , Space , Str "|-" , SoftBreak , Str "a" ]
, CodeBlock ( "" , [] , [] ) " b"
, Para [ Str "\8230" ]
]
Note that this is not recognized as metadata. Changing |-
to |
fixes it. Removing the indentation from b
fixes it. My guess is that pandoc can't convert the blocks (with the code block) into inline content as required by |-
. Still, it can probably be made to do something more graceful here.
And when we have a valid YAML block that can't be converted by pandoc, we should fail with an error rather than treating it as something else. (or at least a warning)
I'm moving this to pandoc, because it's really a pandoc issue, it seems. (I guess I can't transfer it across orgs.)
I submitted this issue to pandoc: https://github.com/jgm/pandoc/issues/8465
MWE:
In
bug.yml
:In
bug.md
,resulted in
Edit: note that the error comes from the abstract, if the abstract is removed, there will be no error.