Skip to content

Commit

Permalink
JATS writer: remove 'role' attribute on 'bold' and 'sc' elements.
Browse files Browse the repository at this point in the history
The JATS spec does not allow these.

Closes #4937.
  • Loading branch information
jgm committed Sep 27, 2018
1 parent 99aae5d commit 5365779
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/Text/Pandoc/Writers/JATS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -344,16 +344,15 @@ 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) =
inTagsSimple "sup" <$> inlinesToJATS opts 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 ''
Expand Down
13 changes: 6 additions & 7 deletions test/writer.jats
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
</boxed-text>
<p>Interpreted markdown in a table:</p>
<p>This is <italic>emphasized</italic></p>
<p>And this is <bold role="strong">strong</bold></p>
<p>And this is <bold>strong</bold></p>
<p>Here’s a simple block:</p>
<boxed-text>
<p>foo</p>
Expand Down Expand Up @@ -614,14 +614,13 @@ These should not be escaped: \$ \\ \&gt; \[ \{</preformat>
<sec id="inline-markup">
<title>Inline Markup</title>
<p>This is <italic>emphasized</italic>, and so <italic>is this</italic>.</p>
<p>This is <bold role="strong">strong</bold>, and so <bold role="strong">is
this</bold>.</p>
<p>This is <bold>strong</bold>, and so <bold>is this</bold>.</p>
<p>An <italic><ext-link ext-link-type="uri" xlink:href="/url">emphasized
link</ext-link></italic>.</p>
<p><bold role="strong"><italic>This is strong and em.</italic></bold></p>
<p>So is <bold role="strong"><italic>this</italic></bold> word.</p>
<p><bold role="strong"><italic>This is strong and em.</italic></bold></p>
<p>So is <bold role="strong"><italic>this</italic></bold> word.</p>
<p><bold><italic>This is strong and em.</italic></bold></p>
<p>So is <bold><italic>this</italic></bold> word.</p>
<p><bold><italic>This is strong and em.</italic></bold></p>
<p>So is <bold><italic>this</italic></bold> word.</p>
<p>This is code: <monospace>&gt;</monospace>, <monospace>$</monospace>,
<monospace>\</monospace>, <monospace>\$</monospace>,
<monospace>&lt;html&gt;</monospace>.</p>
Expand Down

0 comments on commit 5365779

Please sign in to comment.