pandoc-latex-environment
pandoc-latex-environment copied to clipboard
temp fix for stringify not converting MetaString, allowing metadata in defaults file
When metadata is stored in the metadata section of a defaults file,
some of the strings are stored as MetaString
objects, instead of
MetaInline
(which is the case when metadata comes from the document
header).
Unfortunately, pandoc's stringify
currently does not work on MetaString
objects, so this provides a temporary workaround. (This issue has been
reported upstream at https://github.com/jgm/pandoc/issues/7149.)
With this fix, metadata can now be stored in a defaults yaml file, for example:
metadata:
pandoc-latex-environment:
noteblock: [note]
tipblock: [tip]
warningblock: [warning]
cautionblock: [caution]
importantblock: [important]
I accidentally included another commit where I had added some debugging code, sorry about that. The first commit contains everything needed.
nevermind, I managed to remove the unwanted commit. phew
After more investigation upstream, it turns out that the issue is not actually MetaString
or stringify
, but rather the different overall structure of the metadata returned by pandoc in the two different situations (a list of MetaInlines
with a list of one Str
object each, versus a list of MetaString
objects with just a string as content each). As such, I'm not sure if this will change upstream in the near future (or at all), so this "temporary" workaround might very well be necessary longterm...
Fix in current release