Made htmlComment parser more efficient.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1567 788f1e2b-df1e-0410-8736-df70ead52e1b
commitd4d99d281df184eed3c67063fe64b542a154a509
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>
dateWed 29 Apr 2009, 19:28 (17 years ago)
parent59563e5
src/Text/Pandoc/Readers/HTML.hs+3−1
@@ -346,7 +346,9 @@ rawHtmlBlock' = do notFollowedBy' (htmlTag "/body" <|> htmlTag "/html")
346346htmlComment :: GenParser Char st [Char]
347347htmlComment = try $ do
348348 string "<!--"
349− comment <- manyTill anyChar (try (string "-->"))
349+ comment <- many ( (satisfy (/='-'))
350+ <|> (char '-' >>~ notFollowedBy (try $ char '-' >> char '>')))
351+ string "-->"
350352 return $ "<!--" ++ comment ++ "-->"
351353
352354--