aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-21 21:45:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-21 21:45:35 -0800
commit32f9dbbae5e3e1cce43d372db5564da378947388 (patch)
treec76d01da08be27b1ecaadf1afdece9de57b2c0fa /src/Text
parent239cfb7f00773e524a659f1e266c0ff210969d1a (diff)
parenta5d7be075d6aa3afd817bfb754b5c84cac63614b (diff)
downloadpandoc-32f9dbbae5e3e1cce43d372db5564da378947388.tar.gz
Merge branch 'master' of github.com:jgm/pandoc
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index 8824eeb24..901bcb646 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -316,6 +316,9 @@ tableItemToJATS :: PandocMonad m
-> Bool
-> [Block]
-> JATS m Doc
+tableItemToJATS opts isHeader [Plain item] =
+ inTags True (if isHeader then "th" else "td") [] <$>
+ inlinesToJATS opts item
tableItemToJATS opts isHeader item =
(inTags True (if isHeader then "th" else "td") [] . vcat) <$>
mapM (blockToJATS opts) item
@@ -405,8 +408,11 @@ inlineToJATS opts (Link (ident,_,kvs) txt ('#':src, _)) = do
[("alt", stringify txt) | not (null txt)] ++
[("rid", src)] ++
[(k,v) | (k,v) <- kvs, k `elem` ["ref-type", "specific-use"]]
- contents <- inlinesToJATS opts txt
- return $ inTags False "xref" attr contents
+ if null txt
+ then return $ selfClosingTag "xref" attr
+ else do
+ contents <- inlinesToJATS opts txt
+ return $ inTags False "xref" attr contents
inlineToJATS opts (Link (ident,_,kvs) txt (src, tit)) = do
let attr = [("id", ident) | not (null ident)] ++
[("ext-link-type", "uri"),