aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-02-15 10:26:40 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-02-15 10:26:40 -0800
commit39889c22df578a4310bcf549fcd507c08fbf1416 (patch)
tree9298768fdb6ba2241f29e9ef1cbbdf75b1f2b370 /src/Text/Pandoc
parent35df24e698d93d8e9a39099184e62ac0c16770a9 (diff)
downloadpandoc-39889c22df578a4310bcf549fcd507c08fbf1416.tar.gz
JATS writer: Support citations.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index 03bcde414..34c9828eb 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -377,9 +377,10 @@ inlineToJATS opts SoftBreak
inlineToJATS opts (Note contents) =
-- TODO technically only <p> tags are allowed inside
inTagsIndented "fn" <$> blocksToJATS opts contents
-inlineToJATS opts (Cite _ lst) =
- -- TODO revisit this after examining the jats.csl pipeline
- inlinesToJATS opts lst
+inlineToJATS opts (Cite cs lst) = do
+ contents <- inlinesToJATS opts lst
+ let rid = unwords $ map citationId cs
+ return $ inTags False "xref" [("ref-type","bibr"),("rid",rid)] contents
inlineToJATS opts (Span ("",_,[]) ils) = inlinesToJATS opts ils
inlineToJATS opts (Span (ident,_,kvs) ils) = do
contents <- inlinesToJATS opts ils