Use new citeproc; do note capitalization here, not in citeproc.

This commit is contained in:
John MacFarlane 2020-10-29 21:53:02 -07:00
parent bc3f16b0c1
commit 3e6d009c6b
5 changed files with 16 additions and 7 deletions

View file

@ -7,5 +7,5 @@ package pandoc
source-repository-package
type: git
location: https://github.com/jgm/citeproc
tag: ac57c6ceb8fe6583921c5e3f3a3838401191b97c
tag: 3bff6aff18a99b710b25949d039d221f36c3a77c

View file

@ -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

View file

@ -23,7 +23,7 @@ extra-deps:
- commonmark-extensions-0.2.0.1
- commonmark-pandoc-0.2.0.1
- git: https://github.com/jgm/citeproc
commit: ac57c6ceb8fe6583921c5e3f3a3838401191b97c
commit: 3bff6aff18a99b710b25949d039d221f36c3a77c
ghc-options:
"$locals": -fhide-source-paths -Wno-missing-home-modules

View file

@ -123,7 +123,7 @@ Sam Smith. Oxford: Oxford University Press, 2007.
[^9]: See [Doe, *First Book*, 2005, 34--35](#ref-item1).
[^10]: Some citations (See [Doe, chap. 3](#ref-item1); [Doe and Roe,
[^10]: Some citations (see [Doe, chap. 3](#ref-item1); [Doe and Roe,
"Why Water Is Wet"](#ref-пункт3); [Doe, "Article,"
2006](#ref-item2)).

View file

@ -29,7 +29,7 @@ See <https://github.com/jgm/pandoc-citeproc/pull/362>.
[@citekey, p. \[89\]]
[@citekey and nothing else].
[@citekey and nothing else]
[@citekey, 123(4)\[5\]6, and suffix]
@ -79,7 +79,7 @@ See <https://github.com/jgm/pandoc-citeproc/pull/362>.
[^9]
.[^10]
[^10]
[^11]