Closed castedo closed 11 months ago
The problem is splitBackBlocks in https://github.com/jgm/pandoc/commit/4f440583a82d1090dbe212afe77eace8deb0531f
Added a header to the test case in #8364, and it still created a back section. I think this is because that test specifies reference-section-title in the metadata.
Here's the diagnosis. If you end your file with a header or provide reference-section-title
in metadata, a heading will be added to the references, and then makeSections
will create a proper section for it, and splitBackBlocks
will put this section in the back matter.
If you don't create a section heading for your references, then makeSections
will incorporate the references into the final section of the document, and it won't be split into back matter.
One possible fix would be to look for a refs
Div prior to calling makeSections
, and ensure that there is a preceding Header element. (If not, add an empty one?)
Thank for this information, I think I now see a work-around so that I can use the latest release for my document processing.
Some quick information to share since it was confusing me regarding this:
Here's the diagnosis. If you end your file with a header or provide
reference-section-title
in metadata, ...
It seems if one does BOTH end a file with header "# References" AND provides a reference-section-title
of the same title text AND the penultimate section is not empty, then the ref-list
gets misplaced in the body and not placed in back.
Regarding possible fixes, I'm not sure ... but another possibility is to essentially treat reference-section-title
as always having a default value of "References" when outputing JATS XML. But I don't understand the Haskell very well to have a sense on which possibility is better.
This was wrongly closed I think. The commit above has nothing to do with this issue and I think it was just a typo.
Never mind - it was properly closed but not by the referenced issue above.
REPO STEPS Using input-with-heading.md
outputs
EXPECTED
The
<ref-list>
element should be inside<back>
, not<body>
.NOTES
Changing the input heading from "# I like" to just text "I like" eliminates the bug. E.g. using input-no-heading.md outputs the
<ref-list>
inside the<back>
.Pandoc version? I reproduce this with 3.1.6.2, 3.1.6.1, 3.1.4, but not 3.1.3. So this appears to be a regression from 3.1.3 to 3.1.4.