From 3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 29 Oct 2020 21:53:02 -0700 Subject: Use new citeproc; do note capitalization here, not in citeproc. --- src/Text/Pandoc/Citeproc.hs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 1a86db569..57f676115 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -163,8 +163,10 @@ processCitations (Pandoc meta bs) = do _ -> id let Pandoc meta'' bs' = - maybe id (setMeta "nocite") metanocites $ - walk (fixQuotes . mvPunct moveNotes locale) $ walk deNote $ + maybe id (setMeta "nocite") metanocites . + walk (map capitalizeNoteCitation . + fixQuotes . mvPunct moveNotes locale) . + walk deNote . evalState (walkM insertResolvedCitations $ Pandoc meta' bs) $ cits return $ Pandoc meta'' @@ -515,6 +517,13 @@ extractText (FancyVal x) = toText x extractText (NumVal n) = T.pack (show n) extractText _ = mempty +capitalizeNoteCitation :: Inline -> Inline +capitalizeNoteCitation (Cite cs [Note [Para ils]]) = + Cite cs + [Note [Para $ B.toList $ addTextCase Nothing CapitalizeFirst + $ B.fromList ils]] +capitalizeNoteCitation x = x + deNote :: Inline -> Inline deNote (Note bs) = Note $ walk go bs where -- cgit v1.2.3