diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2021-12-19 20:05:58 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-12-19 12:03:01 -0800 |
commit | f8f03c2ffca168d5c897febc2a631c2605973699 (patch) | |
tree | 08e91fc1c35211648cde7ae8a013a1dc0940bfee /src/Text | |
parent | 74c2d9eb07f26da89698e051891fa084ffdfea8e (diff) | |
download | pandoc-f8f03c2ffca168d5c897febc2a631c2605973699.tar.gz |
JATS writer: keep quotes in element-citations
The JATS writer was losing quotes in element-citations, as it uses the
`T.P.Citeproc.getReferences` function to get references. That function
replaces `Quoted` elements with spans. That transformation is required
in `T.P.Citeproc.processCitations`, so it has been moved there.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Citeproc.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 03a15e9f6..2530ef46f 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -55,7 +55,10 @@ processCitations (Pandoc meta bs) = do mblang <- getCiteprocLang meta let locale = Citeproc.mergeLocales mblang style - refs <- getReferences (Just locale) (Pandoc meta bs) + let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs + addQuoteSpan x = x + refs <- map (walk addQuoteSpan) <$> + getReferences (Just locale) (Pandoc meta bs) let otherIdsMap = foldr (\ref m -> case T.words . extractText <$> @@ -206,10 +209,7 @@ getReferences mblocale (Pandoc meta bs) = do Just fp -> getRefsFromBib locale idpred fp Nothing -> return [] Nothing -> return [] - let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs - addQuoteSpan x = x - return $ map (legacyDateRanges . walk addQuoteSpan) - (externalRefs ++ inlineRefs) + return $ map legacyDateRanges (externalRefs ++ inlineRefs) -- note that inlineRefs can override externalRefs |