aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-12-15 08:51:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2020-12-15 08:51:43 -0800
commit7d799bfcda749e4a3ad6fcae59ac5ccb80b77ffd (patch)
treeadcb94164b55ca48f53820ebf0bee71ed93feaf2 /src/Text
parent03c897c7eea4ed3209d6d0fd2aa01f794a5ed893 (diff)
downloadpandoc-7d799bfcda749e4a3ad6fcae59ac5ccb80b77ffd.tar.gz
Allow both inline and external references to be used
with `--citeproc`. This fixes a regression, since pandoc-citeproc allowed these to be combined. Closes #6951.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Citeproc.hs29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
index 0de2882ae..82d1dc32f 100644
--- a/src/Text/Pandoc/Citeproc.hs
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -105,20 +105,21 @@ processCitations (Pandoc meta bs) = do
let idpred = if "*" `Set.member` nocites
then const True
else (`Set.member` citeIds)
- refs <- map (linkifyVariables . legacyDateRanges) <$>
- case lookupMeta "references" meta of
- Just (MetaList rs) -> return $ mapMaybe metaValueToReference rs
- _ ->
- case lookupMeta "bibliography" meta of
- Just (MetaList xs) ->
- mconcat <$>
- mapM (getRefsFromBib locale idpred)
- (mapMaybe metaValueToText xs)
- Just x ->
- case metaValueToText x of
- Just fp -> getRefsFromBib locale idpred fp
- Nothing -> return []
- Nothing -> return []
+ let inlineRefs = case lookupMeta "references" meta of
+ Just (MetaList rs) -> mapMaybe metaValueToReference rs
+ _ -> []
+ externalRefs <- case lookupMeta "bibliography" meta of
+ Just (MetaList xs) ->
+ mconcat <$>
+ mapM (getRefsFromBib locale idpred)
+ (mapMaybe metaValueToText xs)
+ Just x ->
+ case metaValueToText x of
+ Just fp -> getRefsFromBib locale idpred fp
+ Nothing -> return []
+ Nothing -> return []
+ let refs = map (linkifyVariables . legacyDateRanges)
+ (inlineRefs ++ externalRefs)
let otherIdsMap = foldr (\ref m ->
case T.words . extractText <$>
M.lookup "other-ids"