aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-02-05 23:01:17 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-02-05 23:01:35 -0800
commit521e90e8397b2e5485e02dd9bdf070e401ad1bc4 (patch)
tree7c9a4cf1630e0bf9ab269c16a6dfb076bd4fe40d /src/Text
parente2c157f86f985e4ab5c702fff87b647f4ae842c8 (diff)
downloadpandoc-521e90e8397b2e5485e02dd9bdf070e401ad1bc4.tar.gz
Parsing: Make characterReference fail if entity not found.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Parsing.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
index 08769a4f4..0468ceec5 100644
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -342,10 +342,10 @@ escaped parser = try $ char '\\' >> parser
characterReference :: GenParser Char st Char
characterReference = try $ do
char '&'
- ent <- manyTill nonspaceChar (char ';')
+ ent <- many1Till nonspaceChar (char ';')
case lookupEntity ent of
Just c -> return c
- Nothing -> return '?'
+ Nothing -> fail "entity not found"
-- | Parses an uppercase roman numeral and returns (UpperRoman, number).
upperRoman :: GenParser Char st (ListNumberStyle, Int)