aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-30 16:22:54 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-30 16:22:54 +0200
commite5e2a6e0a5c1ef10375e4c94985b3247289d77e9 (patch)
tree8470f84775910969c639eedf85aa7b56bfcc91a7 /src
parentbf651b966bf036ea0a67b6ccde0ce9d4624ecb67 (diff)
downloadpandoc-e5e2a6e0a5c1ef10375e4c94985b3247289d77e9.tar.gz
JATS writer: use both tex and mml alternatives for math when possible.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index 5e1b3164b..71a45bf77 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -381,14 +381,16 @@ inlineToJATS _ (Math t str) = do
let tagtype = case t of
DisplayMath -> "disp-formula"
InlineMath -> "inline-formula"
- return $ inTagsSimple tagtype $
- case res of
- Right r -> text $ Xml.ppcElement conf
- $ fixNS r
- Left _ -> inTagsSimple "tex-math"
+ let rawtex = inTagsSimple "tex-math"
$ text "<![CDATA[" <>
text str <>
text "]]>"
+ return $ inTagsSimple tagtype $
+ case res of
+ Right r -> inTagsSimple "alternatives" $
+ cr <> rawtex $$
+ (text $ Xml.ppcElement conf $ fixNS r)
+ Left _ -> rawtex
inlineToJATS _ (Link _attr [Str t] ('m':'a':'i':'l':'t':'o':':':email, _))
| escapeURI t == email =
return $ inTagsSimple "email" $ text (escapeStringForXML email)