Closed coryschires closed 1 year ago
Ah, I see the problem.
Here, the code only parses one row because it uses filterChild
, it should do something similar to what we do when parsing the body https://github.com/jgm/pandoc/blob/4a6950200ff148b44b38c20f015100bb4d7e5033/src/Text/Pandoc/Readers/JATS.hs#L278 That is, we should use, filterChildren
in order to grab all of the rows that may exist in the thead
According to the jats spec. It is valid for the footer to also have multiple rows. Because the footer code is pretty similar, we should probably also account for multiple rows there too
These changes ended up being pretty small and I added them to a PR I currently have open: https://github.com/jgm/pandoc/pull/8795/files
looks like this was merged, so this issue can be closed, right?
@jgm Yep 👍
Problem
When converting from JATS to HTML, Pandoc drops table headers if the table include more than one row of table headers. More specifically, Pandoc seems to retain only the first table header.
Given the following (abridged) JATS XML:
The following command:
Will produce to following HTML:
Solution / Expected Behavior
Because HTML supports multiple rows of headers, I would expect all table headers to be retained when converting from JATS to HTML:
Steps to recreate
Pandoc Version
Sample JATS XML files
table_with_multiple_header_rows.xml
Commands to reproduce
Thanks for your help! I know @noahmalmed has recently contributed some table fixes (with help from @tarleb). So, if it's not too complicated, I bet we could file a pull request to fix this issue as well.
Any tips to point us in the right direction would be greatly appreciated!