aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Citeproc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-10-29 21:53:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-10-29 21:53:02 -0700
commit3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd (patch)
tree0bb1be314938ec4a6337804a0df05d370a73fd57 /src/Text/Pandoc/Citeproc.hs
parentbc3f16b0c18e0f04a3e9d3e162f57f8e86cadead (diff)
downloadpandoc-3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd.tar.gz
Use new citeproc; do note capitalization here, not in citeproc.
Diffstat (limited to 'src/Text/Pandoc/Citeproc.hs')
-rw-r--r--src/Text/Pandoc/Citeproc.hs13
1 files changed, 11 insertions, 2 deletions
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