From 05640f9a21e7963de4501b85f47cc1daa203c195 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 13 Aug 2021 17:29:58 -0700 Subject: Removed quote localization from citeproc processing. This is now done in citeproc itself. --- cabal.project | 8 ++++---- src/Text/Pandoc/Citeproc.hs | 21 +-------------------- stack.yaml | 6 +++++- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/cabal.project b/cabal.project index 505636326..c5090838c 100644 --- a/cabal.project +++ b/cabal.project @@ -2,7 +2,7 @@ packages: pandoc.cabal tests: True flags: +embed_data_files --- source-repository-package --- type: git --- location: https://github.com/jgm/citeproc --- tag: 4ce0501cd6f9c86eee087afcf878c256e49b9615 +source-repository-package + type: git + location: https://github.com/jgm/citeproc.git + tag: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 246f54516..bfd108655 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -88,13 +88,11 @@ processCitations (Pandoc meta bs) = do _ -> id) $ [] let bibs = mconcat $ map (\(ident, out) -> B.divWith ("ref-" <> ident,["csl-entry"],[]) . B.para . - walk (convertQuotes locale) . insertSpace $ out) (resultBibliography result) let moveNotes = styleIsNoteStyle sopts && maybe True truish (lookupMeta "notes-after-punctuation" meta) - let cits = map (walk (convertQuotes locale)) $ - resultCitations result + let cits = resultCitations result let metanocites = lookupMeta "nocite" meta let Pandoc meta'' bs' = @@ -265,23 +263,6 @@ getRefs locale format idpred mbfp raw = do (L.fromStrict raw) return $ mapMaybe metaValueToReference rs --- localized quotes -convertQuotes :: Locale -> Inline -> Inline -convertQuotes locale (Quoted qt ils) = - case (M.lookup openterm terms, M.lookup closeterm terms) of - (Just ((_,oq):_), Just ((_,cq):_)) -> - Span ("",[],[]) (Str oq : ils ++ [Str cq]) - _ -> Quoted qt ils - where - terms = localeTerms locale - openterm = case qt of - DoubleQuote -> "open-quote" - SingleQuote -> "open-inner-quote" - closeterm = case qt of - DoubleQuote -> "close-quote" - SingleQuote -> "close-inner-quote" -convertQuotes _ x = x - -- assumes we walk in same order as query insertResolvedCitations :: Inline -> State [Inlines] Inline insertResolvedCitations (Cite cs ils) = do diff --git a/stack.yaml b/stack.yaml index 8e52a819f..1bad8cc59 100644 --- a/stack.yaml +++ b/stack.yaml @@ -12,9 +12,13 @@ extra-deps: - skylighting-core-0.11 - skylighting-0.11 - doctemplates-0.10 -- citeproc-0.4.1 +# - citeproc-0.4.1 +- git: https://github.com/jgm/citeproc.git + commit: 8b190eceb0cbbbf2d436bab9a5891a31be0c9865 ghc-options: "$locals": -fhide-source-paths -Wno-missing-home-modules resolver: lts-18.0 nix: packages: [zlib] + + -- cgit v1.2.3