summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-30 15:39:21 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-30 15:39:21 +0200
commit0d06c632b10299d4955fc85c04c73c5796056891 (patch)
tree4db5ae02fc7ea976dcc9790d02358ea6b6da2da9 /src/Text/Pandoc
parent9575dfc97012e52656c7147e66ec093b9479e8e0 (diff)
JATS writer: Fixed bibliography handling.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/JATS.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
index 9aaba78e0..5e1b3164b 100644
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -181,11 +181,12 @@ listItemToJATS opts mbmarker item = do
-- | Convert a Pandoc block element to JATS.
blockToJATS :: PandocMonad m => WriterOptions -> Block -> DB m Doc
blockToJATS _ Null = return empty
--- Add ids to paragraphs in divs with ids - this is needed for
--- pandoc-citeproc to get link anchors in bibliographies:
-blockToJATS opts (Div (ident,_,_) [Para lst]) =
- let attribs = [("id", ident) | not (null ident)] in
- inTags True "p" attribs <$> inlinesToJATS opts lst
+-- Bibliography reference:
+blockToJATS opts (Div ('r':'e':'f':'-':_,_,_) [Para lst]) =
+ inlinesToJATS opts lst
+blockToJATS opts (Div ("refs",_,_) xs) = do
+ contents <- blocksToJATS opts xs
+ return $ inTagsIndented "ref-list" contents
blockToJATS opts (Div (ident,_,kvs) bs) = do
contents <- blocksToJATS opts bs
let attr = [("id", ident) | not (null ident)] ++