git.iko.soy/typeable/pandoc
on master help sign in
JATS writer: don't use break element for LineBreak.

It's only allowed in a few special contexts, and not in p elements.

commitf7c0d2fb3f9ba8ac6c20ea03a2dbe0709c0d026f authorJohn MacFarlane <jgm@berkeley.edu> dateTue 11 Jun 2019, 16:19 (7 years ago) parentbb68c18
2 files changed+4−2
src/Text/Pandoc/Writers/JATS.hs+2−1 test/writer.jats+2−1
src/Text/Pandoc/Writers/JATS.hs+2−1
@@ -390,7 +390,8 @@ inlineToJATS _ il@(RawInline f x)
390390 | otherwise = do
391391 report $ InlineNotRendered il
392392 return empty
393−inlineToJATS _ LineBreak = return $ selfClosingTag "break" []
393+inlineToJATS _ LineBreak = return cr -- not allowed as child of p
394+-- see https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/break.html
394395inlineToJATS _ Space = return space
395396inlineToJATS opts SoftBreak
396397 | writerWrapText opts == WrapPreserve = return cr
test/writer.jats+2−1
@@ -68,7 +68,8 @@ Gruber’s markdown test suite.</p>
6868 item. Because a hard-wrapped line in the middle of a paragraph looked like a
6969 list item.</p>
7070 <p>Here’s one with a bullet. * criminey.</p>
71− <p>There should be a hard line break<break />here.</p>
71+ <p>There should be a hard line break
72+ here.</p>
7273</sec>
7374<sec id="block-quotes">
7475 <title>Block Quotes</title>