aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Citeproc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-12-16 15:37:40 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-12-16 15:37:40 -0800
commit914cf0b602f0585cfd1b401b956c8edfd129d47d (patch)
treef2db056b62e9e8b8346496f2ae91a7ac949c3810 /src/Text/Pandoc/Citeproc.hs
parent41577a66566fe99bcd487723a90af3045dc7faec (diff)
downloadpandoc-914cf0b602f0585cfd1b401b956c8edfd129d47d.tar.gz
Fix citeproc regression with duplicate references.
- Use dev version of citeproc, which handles duplicate ids better, preferring the last one in the list and discarding the rest. - Ensure that inline citations take priority over external ones. See jgm/citeproc#36. This restores the behavior of pandoc-citeproc.
Diffstat (limited to 'src/Text/Pandoc/Citeproc.hs')
-rw-r--r--src/Text/Pandoc/Citeproc.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
index 770d571a6..ca1ab9f96 100644
--- a/src/Text/Pandoc/Citeproc.hs
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -119,7 +119,8 @@ processCitations (Pandoc meta bs) = do
Nothing -> return []
Nothing -> return []
let refs = map (linkifyVariables . legacyDateRanges)
- (inlineRefs ++ externalRefs)
+ (externalRefs ++ inlineRefs)
+ -- note that inlineRefs can override externalRefs
let otherIdsMap = foldr (\ref m ->
case T.words . extractText <$>
M.lookup "other-ids"