JATS reader: handle citations with multiple references.

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

Closes #5310.
This commit is contained in:
John MacFarlane 2019-02-15 10:09:46 -08:00
parent b6c64bdd81
commit 35df24e698

View file

@ -470,16 +470,19 @@ parseInline (Elem e) =
"xref" -> do
ils <- innerInlines
let rid = attrValue "rid" e
let rids = words rid
let refType = ("ref-type",) <$> maybeAttrValue "ref-type" e
let attr = (attrValue "id" e, [], maybeToList refType)
return $ if refType == Just ("ref-type","bibr")
then cite [Citation{
citationId = rid
, citationPrefix = []
, citationSuffix = []
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0}] ils
then cite
(map (\id' ->
Citation{ citationId = id'
, citationPrefix = []
, citationSuffix = []
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0}) rids)
ils
else linkWith attr ('#' : rid) "" ils
"ext-link" -> do
ils <- innerInlines