diff options
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 |