summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-07-18 17:09:45 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2023-07-18 17:09:45 -0700
commitcfc1d6a7b9e75b4a8dcc628f04fa7a73e3c3fbe7 (patch)
tree7bb0d555e7df9558b1bf2ef17a61f005a6b3c2dd
parent52dc8342ab6278da18140bbcb17656927d134341 (diff)
JATS writer: don't use `<code>` for inline code.
See #8889. The Taylor and Francis guide to JATS says that `<code>` is block level and not intended to be used inline within standard text.
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs5
-rw-r--r--test/Tests/Writers/JATS.hs1
2 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index bb770009c..ad18d6cf7 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -419,9 +419,8 @@ inlineToJATS opts (Quoted DoubleQuote lst) = do
contents <- inlinesToJATS opts lst
return $ char '“' <> contents <> char '”'
inlineToJATS opts (Code a str) =
- return $ inTags False tag attr $ literal (escapeStringForXML str)
- where (lang, attr) = codeAttr opts a
- tag = if T.null lang then "monospace" else "code"
+ return $ inTags False "monospace" attr $ literal (escapeStringForXML str)
+ where (_lang, attr) = codeAttr opts a
inlineToJATS _ il@(RawInline f x)
| f == "jats" = return $ literal x
| otherwise = do
diff --git a/test/Tests/Writers/JATS.hs b/test/Tests/Writers/JATS.hs
index 8571ccd1d..6eb5c7d0a 100644
--- a/test/Tests/Writers/JATS.hs
+++ b/test/Tests/Writers/JATS.hs
@@ -40,7 +40,6 @@ tests :: [TestTree]
tests =
[ testGroup "inline code"
[ "basic" =: code "@&" =?> "<p><monospace>@&amp;</monospace></p>"
- , "lang" =: codeWith ("", ["c"], []) "@&" =?> "<p><code language=\"c\">@&amp;</code></p>"
]
, testGroup "block code"
[ "basic" =: codeBlock "@&" =?> "<preformat>@&amp;</preformat>"