aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs6
-rw-r--r--tests/markdown-citations.chicago-author-date.txt2
-rw-r--r--tests/markdown-citations.mhra.txt2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index f04ea88c4..ab146bdd0 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1321,8 +1321,12 @@ citeKey = try $ do
suffix :: GenParser Char ParserState [Inline]
suffix = try $ do
+ hasSpace <- option False (notFollowedBy nonspaceChar >> return True)
spnl
- liftM normalizeSpaces $ many $ notFollowedBy (oneOf ";]") >> inline
+ rest <- liftM normalizeSpaces $ many $ notFollowedBy (oneOf ";]") >> inline
+ return $ if hasSpace
+ then Space : rest
+ else rest
prefix :: GenParser Char ParserState [Inline]
prefix = liftM normalizeSpaces $
diff --git a/tests/markdown-citations.chicago-author-date.txt b/tests/markdown-citations.chicago-author-date.txt
index 11d84dadc..07539faf4 100644
--- a/tests/markdown-citations.chicago-author-date.txt
+++ b/tests/markdown-citations.chicago-author-date.txt
@@ -22,7 +22,7 @@
- Citation with a suffix and locator (Doe 2005, 33, 35–37, and nowhere else).
-- Citation with suffix only (Doe 2005, and nowhere else).
+- Citation with suffix only (Doe 2005 and nowhere else).
- Now some modifiers.[^3]
diff --git a/tests/markdown-citations.mhra.txt b/tests/markdown-citations.mhra.txt
index 56eb147a3..ed3f1c850 100644
--- a/tests/markdown-citations.mhra.txt
+++ b/tests/markdown-citations.mhra.txt
@@ -54,7 +54,7 @@ Doe, John, and Jenny Roe, ‘Why Water Is Wet’, in *Third Book*, ed by Sam Smi
[^9]: Doe, First Book, pp. 33, 35-37, and nowhere else.
-[^10]: Doe, First Book, and nowhere else.
+[^10]: Doe, First Book and nowhere else.
[^11]: Like a citation without author: First Book, and now Doe with a locator Article, 33-34 (p. 44).