diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-02-05 23:01:17 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-02-05 23:01:35 -0800 |
commit | 521e90e8397b2e5485e02dd9bdf070e401ad1bc4 (patch) | |
tree | 7c9a4cf1630e0bf9ab269c16a6dfb076bd4fe40d /src/Text | |
parent | e2c157f86f985e4ab5c702fff87b647f4ae842c8 (diff) | |
download | pandoc-521e90e8397b2e5485e02dd9bdf070e401ad1bc4.tar.gz |
Parsing: Make characterReference fail if entity not found.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 4 |
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) |