summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-04-06 23:12:07 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2022-04-06 23:14:10 -0700
commit7fb74b74df705742001ca583c4070b29e61ea275 (patch)
tree989b62bbf4c96e17ce0d2c39e64656836c43f911 /src
parent125210c108e234f977f0c37883378b923ba7d2be (diff)
JATS reader: strip `ref-` prefix from ref id in xref.
This completes commit 807a574e9d33fcf66928388e342cc1436eb2346e. Closes #8007.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/JATS.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
index 9442e2506..930fc29fd 100644
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -528,7 +528,9 @@ parseInline (Elem e) =
return $ if refType == Just ("ref-type","bibr")
then cite
(map (\id' ->
- Citation{ citationId = id'
+ let id'' = fromMaybe id' $
+ T.stripPrefix "ref-" id'
+ in Citation { citationId = id''
, citationPrefix = []
, citationSuffix = []
, citationMode = NormalCitation