From 82638ad53bb47acde835083390f8211ac21cda6c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 19:19:43 -0700 Subject: Convert Quoted in bib entries to special Spans... before passing them off to citeproc. This ensures that we get proper localization and flipflopping if, e.g., quotes are used in titles. Closes jgm/citeproc#87. --- src/Text/Pandoc/Citeproc.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 0f007f336..39760776d 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -208,7 +208,9 @@ getReferences mblocale (Pandoc meta bs) = do Just fp -> getRefsFromBib locale idpred fp Nothing -> return [] Nothing -> return [] - return $ map (linkifyVariables . legacyDateRanges) + let addQuoteSpan (Quoted _ xs) = Span ("",["csl-quoted"],[]) xs + addQuoteSpan x = x + return $ map (linkifyVariables . legacyDateRanges . walk addQuoteSpan) (externalRefs ++ inlineRefs) -- note that inlineRefs can override externalRefs -- cgit v1.2.3