git.iko.soy/typeable/pandoc
on master help sign in
JATS reader: handle citations with multiple references.

The rid attribute can have a space-separated list of ids. Closes #5310.

commit35df24e698d93d8e9a39099184e62ac0c16770a9 authorJohn MacFarlane <jgm@berkeley.edu> dateFri 15 Feb 2019, 10:09 (8 years ago) parentb6c64bd
1 file changed+10−7
src/Text/Pandoc/Readers/JATS.hs+10−7
src/Text/Pandoc/Readers/JATS.hs+10−7
@@ -470,16 +470,19 @@ parseInline (Elem e) =
470470 "xref" -> do
471471 ils <- innerInlines
472472 let rid = attrValue "rid" e
473+ let rids = words rid
473474 let refType = ("ref-type",) <$> maybeAttrValue "ref-type" e
474475 let attr = (attrValue "id" e, [], maybeToList refType)
475476 return $ if refType == Just ("ref-type","bibr")
476− then cite [Citation{
477− citationId = rid
478− , citationPrefix = []
479− , citationSuffix = []
480− , citationMode = NormalCitation
481− , citationNoteNum = 0
482− , citationHash = 0}] ils
477+ then cite
478+ (map (\id' ->
479+ Citation{ citationId = id'
480+ , citationPrefix = []
481+ , citationSuffix = []
482+ , citationMode = NormalCitation
483+ , citationNoteNum = 0
484+ , citationHash = 0}) rids)
485+ ils
483486 else linkWith attr ('#' : rid) "" ils
484487 "ext-link" -> do
485488 ils <- innerInlines