aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-11-22 23:09:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-11-22 23:09:30 -0800
commitb48fa0ea59da6b32924d2f042c8a7411a03f89d4 (patch)
tree3eef94cbc7c147f1dcf44932529d4d8b226fb3bb /src/Text
parent3c7c1d8574667d183514d87684edd5f1cd886509 (diff)
downloadpandoc-b48fa0ea59da6b32924d2f042c8a7411a03f89d4.tar.gz
Check biblio for all citations, not just textual.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index d59f8a71a..2d3ad1199 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -1332,9 +1332,6 @@ noneOfUnlessEscaped cs =
textualCite :: GenParser Char ParserState [Citation]
textualCite = try $ do
(_, key) <- citeKey
- st <- getState
- unless (key `elem` stateCitations st) $
- fail "not a citation"
let first = Citation{ citationId = key
, citationPrefix = []
, citationSuffix = []
@@ -1368,13 +1365,16 @@ normalCite = try $ do
char ']'
return citations
-citeKey :: GenParser Char st (Bool, String)
+citeKey :: GenParser Char ParserState (Bool, String)
citeKey = try $ do
suppress_author <- option False (char '-' >> return True)
char '@'
first <- letter
rest <- many $ (noneOf ",;]@ \t\n")
- return (suppress_author, first:rest)
+ let key = first:rest
+ st <- getState
+ guard $ key `elem` stateCitations st
+ return (suppress_author, key)
locator :: GenParser Char st String
locator = try $ do