Markdown citations: don't strip off initial space in locator.

Previously `[@item1 and nowhere else]` yielded the locator ", and nowhere
else", or, with the new citeproc-hs, "and nowhere else".
Now it yields " and nowhere else".
This commit is contained in:
John MacFarlane 2011-11-09 13:18:01 -08:00
parent 6a51897f33
commit d74e8d14a5
3 changed files with 7 additions and 3 deletions

View file

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

View file

@ -22,7 +22,7 @@
- Citation with a suffix and locator (Doe 2005, 33, 3537, 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]

View file

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