Closed smancill closed 3 years ago
@blake-riley please review.
Agh, it works with every Pandoc version I tried on my Mac. I need to figure out why the CI is failing.
Rebased to fix the CI ($(</dev/stdin)
was not working so I went back to $(cat -)
).
Support for Pandoc 2.10 is not working, and all the tests are broken too, they do not check anything.
This PR fixes Pandoc 2.10 support, and also fixes the tests to ensure they do run (and updates them to the changes introduced by 7a49118).
Commit 6e1b2cc introduced support for Pandoc 2.10 but it doesn't work because it treats the new
Table.caption.long
object as the pre 2.10Table.caption
object, but they are completely different lists.Table.caption.long
is a list ofBlocks
, where each block has acontent
key which is aList
of inlines (or it should be, a test would be needed for more complex captions?). The pre 2.10Table.caption
is aList
of inlines, so they cannot share the same code to be manipulated.This PR fixes it by just splitting the code into two different functions. They do follow the same structure, but it is better to keep them separated, otherwise it would require too many ifs, or code that is not clear.
For pre 2.10
Table.caption
just keep the code as it is. For the newTable.caption.long
, ensure the outer list ofBlocks
is taken into account when searching for the inlineSpan
with the short caption.Now all test do run and all pass, with pre and post Pandoc 2.10 (
nix-run-version
is a helper that allows me to use nixpkgs releases to run different versions of a command)Before this PR (well, not really, this PR also fixes the tests to see them failing. Before the last commit fixing 2.10 support):
With this PR: