diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-10-29 21:53:02 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-10-29 21:53:02 -0700 |
commit | 3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd (patch) | |
tree | 0bb1be314938ec4a6337804a0df05d370a73fd57 /src/Text/Pandoc | |
parent | bc3f16b0c18e0f04a3e9d3e162f57f8e86cadead (diff) | |
download | pandoc-3e6d009c6b33f25dea2ff1cb13298dfa3ec0bddd.tar.gz |
Use new citeproc; do note capitalization here, not in citeproc.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Citeproc.hs | 13 |
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 |