jats writer: Self closing tags for empty xref (#4187)

This commit is contained in:
Hamish Mackenzie 2017-12-22 18:29:03 +13:00 committed by John MacFarlane
parent 3c10951023
commit de8c47eae8

View file

@ -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"),