diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-08-13 18:13:06 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-08-13 18:13:06 -0700 |
commit | 15683bb607eb924816adcb7e7884fe722d3d3129 (patch) | |
tree | b4f01f775dd9cf37fa60db812e820523776d8503 /src/Text/Pandoc/Citeproc.hs | |
parent | 05640f9a21e7963de4501b85f47cc1daa203c195 (diff) | |
download | pandoc-15683bb607eb924816adcb7e7884fe722d3d3129.tar.gz |
Citeproc: avoid odd handling of quotes.
citeproc changes allow us to ignore Quoted elements;
citeproc now uses its own method for represented quoted
things, and only localizes and flipflops quotes it adds itself.
See #87.
The one thing left to do is to convert Quoted elements in
bibliography databases (esp. titles) to `Span ("",["csl-quoted"],[])`
before passing them to citeproc, IF the localized quotes
for the quote type match the standard inverted commas.
Diffstat (limited to 'src/Text/Pandoc/Citeproc.hs')
-rw-r--r-- | src/Text/Pandoc/Citeproc.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index bfd108655..0f007f336 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -103,10 +103,15 @@ processCitations (Pandoc meta bs) = do else id) . evalState (walkM insertResolvedCitations $ Pandoc meta' bs) $ cits - return $ Pandoc meta'' + return $ walk removeQuoteSpan + $ Pandoc meta'' $ insertRefs refkvs classes meta'' (walk fixLinks $ B.toList bibs) bs' +removeQuoteSpan :: Inline -> Inline +removeQuoteSpan (Span ("",["csl-quoted"],[]) xs) = Span nullAttr xs +removeQuoteSpan x = x + -- | Retrieve the CSL style specified by the csl or citation-style -- metadata field in a pandoc document, or the default CSL style -- if none is specified. Retrieve the parent style |