From 53657798cdd3b64165a2c2885bb4eefbf3ddafdf Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 27 Sep 2018 13:18:06 -0700 Subject: [PATCH] JATS writer: remove 'role' attribute on 'bold' and 'sc' elements. The JATS spec does not allow these. Closes #4937. --- src/Text/Pandoc/Writers/JATS.hs | 5 ++--- test/writer.jats | 13 ++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs index fb3236bd942f..f55a49d4e6a3 100644 --- a/src/Text/Pandoc/Writers/JATS.hs +++ b/src/Text/Pandoc/Writers/JATS.hs @@ -344,7 +344,7 @@ inlineToJATS _ (Str str) = return $ text $ escapeStringForXML str inlineToJATS opts (Emph lst) = inTagsSimple "italic" <$> inlinesToJATS opts lst inlineToJATS opts (Strong lst) = - inTags False "bold" [("role", "strong")] <$> inlinesToJATS opts lst + inTagsSimple "bold" <$> inlinesToJATS opts lst inlineToJATS opts (Strikeout lst) = inTagsSimple "strike" <$> inlinesToJATS opts lst inlineToJATS opts (Superscript lst) = @@ -352,8 +352,7 @@ inlineToJATS opts (Superscript lst) = inlineToJATS opts (Subscript lst) = inTagsSimple "sub" <$> inlinesToJATS opts lst inlineToJATS opts (SmallCaps lst) = - inTags False "sc" [("role", "smallcaps")] <$> - inlinesToJATS opts lst + inTagsSimple "sc" <$> inlinesToJATS opts lst inlineToJATS opts (Quoted SingleQuote lst) = do contents <- inlinesToJATS opts lst return $ char '‘' <> contents <> char '’' diff --git a/test/writer.jats b/test/writer.jats index b51addf3b660..f87b2325acdd 100644 --- a/test/writer.jats +++ b/test/writer.jats @@ -583,7 +583,7 @@ These should not be escaped: \$ \\ \> \[ \{

Interpreted markdown in a table:

This is emphasized

-

And this is strong

+

And this is strong

Here’s a simple block:

foo

@@ -614,14 +614,13 @@ These should not be escaped: \$ \\ \> \[ \{ Inline Markup

This is emphasized, and so is this.

-

This is strong, and so is - this.

+

This is strong, and so is this.

An emphasized link.

-

This is strong and em.

-

So is this word.

-

This is strong and em.

-

So is this word.

+

This is strong and em.

+

So is this word.

+

This is strong and em.

+

So is this word.

This is code: >, $, \, \$, <html>.