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:
parent
b6c64bdd81
commit
35df24e698
1 changed files with 10 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue