aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--cabal.project8
-rw-r--r--pandoc.cabal2
-rw-r--r--src/Text/Pandoc/Citeproc.hs3
-rw-r--r--stack.yaml8
4 files changed, 11 insertions, 10 deletions
diff --git a/cabal.project b/cabal.project
index 091c78ce6..55d4abaa2 100644
--- a/cabal.project
+++ b/cabal.project
@@ -9,8 +9,8 @@ source-repository-package
location: https://github.com/jgm/doctemplates.git
tag: 7ccbf7df16edbc7c5d835d955b242c61fd4e6601
--- source-repository-package
--- type: git
--- location: https://github.com/jgm/citeproc
--- tag: 42b1d154b02435229acbe98ae0f17d01b757ee93
+source-repository-package
+ type: git
+ location: https://github.com/jgm/citeproc
+ tag: a8193fe375fa2354049bf9a967ba3bad4b1ba053
diff --git a/pandoc.cabal b/pandoc.cabal
index 9244d25cd..d21d5e03c 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -400,7 +400,7 @@ library
blaze-markup >= 0.8 && < 0.9,
bytestring >= 0.9 && < 0.12,
case-insensitive >= 1.2 && < 1.3,
- citeproc >= 0.2.0.1 && < 0.3,
+ citeproc >= 0.3 && < 0.4,
commonmark >= 0.1.1.2 && < 0.2,
commonmark-extensions >= 0.2.0.4 && < 0.3,
commonmark-pandoc >= 0.2 && < 0.3,
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"
diff --git a/stack.yaml b/stack.yaml
index 518c24b63..92a80c4ff 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -20,10 +20,10 @@ extra-deps:
- doctemplates:
git: https://github.com/jgm/doctemplates.git
commit: 7ccbf7df16edbc7c5d835d955b242c61fd4e6601
-- citeproc-0.2.0.1
-# - citeproc:
-# git: https://github.com/jgm/citeproc.git
-# commit: 42b1d154b02435229acbe98ae0f17d01b757ee93
+# - citeproc-0.2.0.1
+- citeproc:
+ git: https://github.com/jgm/citeproc.git
+ commit: a8193fe375fa2354049bf9a967ba3bad4b1ba053
ghc-options:
"$locals": -fhide-source-paths -Wno-missing-home-modules
resolver: lts-16.23