JATS writer: avoid doubled ref-list element.

Previously when generating JATS with the `element_citations`
extension enabled, the references were put in a doubly-nested
ref-list element (`<ref-list><ref-list>...`).  This is now fixed.

Closes #7990.
This commit is contained in:
John MacFarlane 2022-03-27 09:32:55 -07:00
parent e2923747a4
commit 35350fac85
2 changed files with 61 additions and 63 deletions

View file

@ -37,7 +37,7 @@ referencesToJATS :: PandocMonad m
-> [Reference Inlines]
-> JATS m (Doc Text)
referencesToJATS opts =
fmap (inTags True "ref-list" [] . vcat) . mapM (referenceToJATS opts)
fmap vcat . mapM (referenceToJATS opts)
referenceToJATS :: PandocMonad m
=> WriterOptions

View file

@ -79,68 +79,66 @@ references:
</body>
<back>
<ref-list>
<ref-list>
<ref id="ref-year-month">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Jane</surname><given-names>Doe</given-names></name>
</person-group>
<article-title>Year and month</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1999-08">1999</year><month>08</month>
</element-citation>
</ref>
<ref id="ref-access-date">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Negidius</surname><given-names>Numerius</given-names></name>
<etal/>
</person-group>
<article-title>Entry with access date and et al.</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1911-10-03">1911</year><month>10</month><day>03</day>
<date-in-citation content-type="access-date"><year iso-8601-date="1999-01-22">1999</year><month>01</month><day>22</day></date-in-citation>
</element-citation>
</ref>
<ref id="ref-name-particles">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Beethoven</surname><given-names>Ludwig van</given-names></name>
<name><surname>de Bray</surname><given-names>Jan</given-names></name>
</person-group>
<article-title>Name particles, dropping and non-dropping</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1820">1820</year>
</element-citation>
</ref>
<ref id="ref-book-with-japanese-authors">
<element-citation publication-type="book">
<person-group person-group-type="author">
<string-name>宮水 三葉</string-name>
<string-name>立花 瀧</string-name>
</person-group>
<source>Big Book of Tests</source>
<year iso-8601-date="2016">2016</year>
</element-citation>
</ref>
<ref id="ref-full-journal-article-entry">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Watson</surname><given-names>J. D.</given-names></name>
<name><surname>Crick</surname><given-names>F. H. C.</given-names></name>
</person-group>
<article-title>Molecular Structure of Nucleic Acids: A Structure for Deoxyribose Nucleic Acid</article-title>
<source>Nature</source>
<year iso-8601-date="1953-04-01">1953</year><month>04</month><day>01</day>
<volume>171</volume>
<issue>4356</issue>
<fpage>737</fpage>
<page-range>737-738</page-range>
<pub-id pub-id-type="doi">10.1038/171737a0</pub-id>
<pub-id pub-id-type="pmid">13054692</pub-id>
</element-citation>
</ref>
</ref-list>
<ref id="ref-year-month">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Jane</surname><given-names>Doe</given-names></name>
</person-group>
<article-title>Year and month</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1999-08">1999</year><month>08</month>
</element-citation>
</ref>
<ref id="ref-access-date">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Negidius</surname><given-names>Numerius</given-names></name>
<etal/>
</person-group>
<article-title>Entry with access date and et al.</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1911-10-03">1911</year><month>10</month><day>03</day>
<date-in-citation content-type="access-date"><year iso-8601-date="1999-01-22">1999</year><month>01</month><day>22</day></date-in-citation>
</element-citation>
</ref>
<ref id="ref-name-particles">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Beethoven</surname><given-names>Ludwig van</given-names></name>
<name><surname>de Bray</surname><given-names>Jan</given-names></name>
</person-group>
<article-title>Name particles, dropping and non-dropping</article-title>
<source>Public Library of Tests</source>
<year iso-8601-date="1820">1820</year>
</element-citation>
</ref>
<ref id="ref-book-with-japanese-authors">
<element-citation publication-type="book">
<person-group person-group-type="author">
<string-name>宮水 三葉</string-name>
<string-name>立花 瀧</string-name>
</person-group>
<source>Big Book of Tests</source>
<year iso-8601-date="2016">2016</year>
</element-citation>
</ref>
<ref id="ref-full-journal-article-entry">
<element-citation publication-type="article-journal">
<person-group person-group-type="author">
<name><surname>Watson</surname><given-names>J. D.</given-names></name>
<name><surname>Crick</surname><given-names>F. H. C.</given-names></name>
</person-group>
<article-title>Molecular Structure of Nucleic Acids: A Structure for Deoxyribose Nucleic Acid</article-title>
<source>Nature</source>
<year iso-8601-date="1953-04-01">1953</year><month>04</month><day>01</day>
<volume>171</volume>
<issue>4356</issue>
<fpage>737</fpage>
<page-range>737-738</page-range>
<pub-id pub-id-type="doi">10.1038/171737a0</pub-id>
<pub-id pub-id-type="pmid">13054692</pub-id>
</element-citation>
</ref>
</ref-list>
</back>
</article>