From f7c0d2fb3f9ba8ac6c20ea03a2dbe0709c0d026f Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 11 Jun 2019 16:19:12 -0700 Subject: [PATCH] JATS writer: don't use break element for LineBreak. It's only allowed in a few special contexts, and not in p elements. --- src/Text/Pandoc/Writers/JATS.hs | 3 ++- test/writer.jats | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index c5e86956b..07a49ceac 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -390,7 +390,8 @@ inlineToJATS _ il@(RawInline f x) | otherwise = do report $ InlineNotRendered il return empty -inlineToJATS _ LineBreak = return $ selfClosingTag "break" [] +inlineToJATS _ LineBreak = return cr -- not allowed as child of p +-- see https://jats.nlm.nih.gov/publishing/tag-library/1.2/element/break.html inlineToJATS _ Space = return space inlineToJATS opts SoftBreak | writerWrapText opts == WrapPreserve = return cr diff --git a/test/writer.jats b/test/writer.jats index ae24f3e50..ba5736cdd 100644 --- a/test/writer.jats +++ b/test/writer.jats @@ -68,7 +68,8 @@ Gruber’s markdown test suite.

item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.

Here’s one with a bullet. * criminey.

-

There should be a hard line breakhere.

+

There should be a hard line break + here.

Block Quotes