From 1742821c3edb7d5d2ed7ced265e3b4c9f00e622a Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 7 Oct 2020 11:23:28 -0700 Subject: [PATCH] Fix URL prefixes in citations also when they occur in notes. Update chicago-fullnote-bibliography.csl and adjust tests. Closes #6723. --- src/Text/Pandoc/Citeproc.hs | 6 +- test/command/6723.md | 33 ++ .../command/chicago-fullnote-bibliography.csl | 466 ++++++++++++++---- test/command/citeproc-7a.md | 2 +- test/command/pandoc-citeproc-360.md | 8 +- test/command/pandoc-citeproc-68.md | 4 +- test/command/pandoc-citeproc-77.md | 8 +- ...-citeproc-chicago-fullnote-bibliography.md | 11 +- ...andoc-citeproc-move-period-inside-quote.md | 5 +- 9 files changed, 411 insertions(+), 132 deletions(-) create mode 100644 test/command/6723.md diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs index 528be6cd7..a5cd26d18 100644 --- a/src/Text/Pandoc/Citeproc.hs +++ b/src/Text/Pandoc/Citeproc.hs @@ -164,9 +164,9 @@ processCitations (Pandoc meta bs) = do walk (fixQuotes . mvPunct moveNotes locale) $ walk deNote $ evalState (walkM insertResolvedCitations $ Pandoc meta' bs) $ cits - return $ Pandoc meta'' - $ insertRefs refkvs classes meta'' - (walk fixLinks $ B.toList bibs) bs' + return $ walk fixLinks + $ Pandoc meta'' + $ insertRefs refkvs classes meta'' (B.toList bibs) bs' -- If we have a span.csl-left-margin followed by span.csl-right-inline, -- we insert a space. This ensures that they will be separated by a space, diff --git a/test/command/6723.md b/test/command/6723.md new file mode 100644 index 000000000..f4455fcce --- /dev/null +++ b/test/command/6723.md @@ -0,0 +1,33 @@ +``` +% pandoc --citeproc -t markdown-citations +--- +csl: command/chicago-fullnote-bibliography.csl +references: +- id: doe + type: article + author: + - family: Doe + given: John + DOI: 10.1109/5.771073 + issued: + - year: 2020 + title: An article +... +Blah [@doe]. + +# References {-} + +^D +Blah.[^1] + +References {#references .unnumbered} +========== + +::: {#refs .references .csl-bib-body .hanging-indent} +::: {#ref-doe .csl-entry} +Doe, John. "An Article," 2020. . +::: +::: + +[^1]: John Doe, "An Article," 2020, . +``` diff --git a/test/command/chicago-fullnote-bibliography.csl b/test/command/chicago-fullnote-bibliography.csl index 5bcfe59b3..7d9c48c54 100644 --- a/test/command/chicago-fullnote-bibliography.csl +++ b/test/command/chicago-fullnote-bibliography.csl @@ -1,7 +1,7 @@ -