aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index eb9646df2..0d0e850bc 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1332,9 +1332,9 @@ textualCite = try $ do
spnl
char '['
spnl
- bareloc <- option "" locator
+ bareloc <- option "" $ notFollowedBy (oneOf "-@") >> locator
rest <- many $ try $ do
- char ';'
+ optional $ char ';'
spnl
citation
spnl
@@ -1366,10 +1366,10 @@ locator = try $ do
(char '\n' >> notFollowedBy blankline >> return ' ')
prefix :: GenParser Char st String
-prefix = try $ liftM removeLeadingTrailingSpace $
- many $ (char '\\' >> anyChar) <|> noneOf "@]\n" <|>
- (char '-' >> notFollowedBy (char '@') >> return '-') <|>
- (char '\n' >> notFollowedBy blankline >> return ' ')
+prefix = liftM removeLeadingTrailingSpace $
+ many $ (char '\\' >> anyChar) <|> noneOf "-@]\n" <|>
+ (try $ char '-' >> notFollowedBy (char '@') >> return '-') <|>
+ (try $ char '\n' >> notFollowedBy blankline >> return ' ')
citeList :: GenParser Char st [Citation]
citeList = try $ do
@@ -1387,10 +1387,10 @@ citeList = try $ do
citation :: GenParser Char st Citation
citation = try $ do
- suppress_auth <- option False (char '-' >> return True)
pref <- prefix
+ suppress_auth <- option False (char '-' >> return True)
key <- citeKey
- loc <- locator
+ loc <- option "" locator
return $ Citation{ citationId = key
, citationPrefix = pref
, citationLocator = loc