git.iko.soy/typeable/pandoc
on master help sign in
Fix truncation of `[Citation]` list in `Cite` inside footnotes...

This affected author-in-text citations in footnotes. It didn't cause problems for the printed output, but for filters that expected the citation id and other information. Closes #6890.

commit815976d5378398933322006e78d140bb8de6eb80 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 25 Nov 2020, 09:08 (6 years ago) parentc6f2663
2 files changed+38−2
src/Text/Pandoc/Citeproc.hs+2−2 test/command/6890.md+36
src/Text/Pandoc/Citeproc.hs+2−2
@@ -527,9 +527,9 @@ deNote (Note bs:rest) =
527527 go [] = []
528528 go (Cite (c:cs) ils : zs)
529529 | citationMode c == AuthorInText
530− = Cite cs (concatMap (noteAfterComma (needsPeriod zs)) ils) : go zs
530+ = Cite (c:cs) (concatMap (noteAfterComma (needsPeriod zs)) ils) : go zs
531531 | otherwise
532− = Cite cs (concatMap noteInParens ils) : go zs
532+ = Cite (c:cs) (concatMap noteInParens ils) : go zs
533533 go (x:xs) = x : go xs
534534 needsPeriod [] = True
535535 needsPeriod (Str t:_) = case T.uncons t of
test/command/6890.mdnew file+36
@@ -0,0 +1,36 @@
1+```
2+% pandoc -t native --citeproc
3+---
4+references:
5+- author:
6+ - family: Früchtel
7+ given: Frank
8+ - family: Budde
9+ given: Wolfgang
10+ - family: Cyprian
11+ given: Gudrun
12+ edition: 3
13+ id: fruchtel-sozialer-2013a
14+ issued: 2013
15+ language: de-DE
16+ publisher: Springer VS
17+ publisher-place: Wiesbaden, Germany
18+ title: "Sozialer Raum und Soziale Arbeit Fieldbook: Methoden und
19+ Techniken"
20+ title-short: Sozialer Raum und Soziale Arbeit Fieldbook
21+ type: book
22+---
23+
24+@fruchtel-sozialer-2013a
25+
26+Some text [^1].
27+
28+[^1]: @fruchtel-sozialer-2013a
29+^D
30+[Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]
31+,Para [Str "Some",Space,Str "text",Str ".",Note [Para [Cite [Citation {citationId = "fruchtel-sozialer-2013a", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "Fr\252chtel,",Space,Str "Budde,",Space,Str "and",Space,Str "Cyprian",Space,Str "(2013)"]]],Str ""]
32+,Div ("refs",["references","csl-bib-body","hanging-indent"],[])
33+ [Div ("ref-fruchtel-sozialer-2013a",["csl-entry"],[])
34+ [Para [Str "Fr\252chtel,",Space,Str "Frank,",Space,Str "Wolfgang",Space,Str "Budde,",Space,Str "and",Space,Str "Gudrun",Space,Str "Cyprian.",Space,Str "2013.",Space,Emph [Str "Sozialer",Space,Str "Raum",Space,Str "und",Space,Str "Soziale",Space,Str "Arbeit",Space,Str "Fieldbook:",Space,Str "Methoden",Space,Str "und",Space,Str "Techniken"],Str ".",Space,Str "3rd",Space,Str "ed.",Space,Str "Wiesbaden,",Space,Str "Germany:",Space,Str "Springer",Space,Str "VS."]]]]
35+```
36+