aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorHamish Mackenzie <Hamish.K.Mackenzie@googlemail.com>2017-12-22 18:29:03 +1300
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-21 22:29:03 -0700
commitde8c47eae807ae8ecc96eb24cd1fed6cf8e6b932 (patch)
tree26a3d5abb002228e49fff0c3759b67583fd15b77 /src/Text/Pandoc
parent3c10951023bc9767a0281b861b53e2014e7b350c (diff)
downloadpandoc-de8c47eae807ae8ecc96eb24cd1fed6cf8e6b932.tar.gz
jats writer: Self closing tags for empty xref (#4187)
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index 8824eeb24..ee3d61015 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -405,8 +405,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"),