From 521e90e8397b2e5485e02dd9bdf070e401ad1bc4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 5 Feb 2012 23:01:17 -0800 Subject: Parsing: Make characterReference fail if entity not found. --- src/Text/Pandoc/Parsing.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') 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) -- cgit v1.2.3