aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-02-04 23:28:46 -0800
committerJohn MacFarlane <[email protected]>2022-02-04 23:28:46 -0800
commitb7f1c97b6a6ab129fc994f2a5502a44f12bad0de (patch)
treea5846fe83c7e9b9df79183e3cda765d4130ede95
parentf48890eff0aa3ca6c12b6e7abbc2b7ec1f4d56a3 (diff)
Docx zotero/mendeley/endnote: add comma before locator in suffix.
-rw-r--r--src/Text/Pandoc/Readers/Docx.hs6
-rw-r--r--test/docx/mendeley_citations_plus.native4
-rw-r--r--test/docx/zotero_citations_plus.native2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
index faef5b517..5f20477d2 100644
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -503,9 +503,9 @@ handleCitation citation = do
, citationPrefix = maybe [] (toList . text) $
Citeproc.citationItemPrefix item
, citationSuffix = (toList . text) $
- maybe mempty (\x ->
- fromMaybe "" (Citeproc.citationItemLabel item)
- <> " " <> x <> " ")
+ maybe mempty (\x -> ", " <>
+ maybe "" (<>" ") (Citeproc.citationItemLabel item)
+ <> x <> " ")
(Citeproc.citationItemLocator item)
<> fromMaybe mempty (Citeproc.citationItemSuffix item)
, citationMode = NormalCitation -- TODO for now
diff --git a/test/docx/mendeley_citations_plus.native b/test/docx/mendeley_citations_plus.native
index d3226b0c6..53867ca22 100644
--- a/test/docx/mendeley_citations_plus.native
+++ b/test/docx/mendeley_citations_plus.native
@@ -268,7 +268,7 @@ Pandoc
{ citationId = "ITEM-1"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Space , Str "123" , Space , Str "suffix" ]
+ [ Str ",", Space , Str "123" , Space , Str "suffix" ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0
@@ -302,7 +302,7 @@ Pandoc
{ citationId = "ITEM-1"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Space , Str "10-20" , Space , Str "suffix" ]
+ [ Str ",", Space , Str "10-20" , Space , Str "suffix" ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0
diff --git a/test/docx/zotero_citations_plus.native b/test/docx/zotero_citations_plus.native
index df8849fca..829fda8b7 100644
--- a/test/docx/zotero_citations_plus.native
+++ b/test/docx/zotero_citations_plus.native
@@ -412,7 +412,7 @@ Pandoc
{ citationId = "10"
, citationPrefix = [ Str "prefix" ]
, citationSuffix =
- [ Space , Str "2" , Space , Str "suffix" ]
+ [ Str ",", Space , Str "2" , Space , Str "suffix" ]
, citationMode = NormalCitation
, citationNoteNum = 0
, citationHash = 0