summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/HTML.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-04-29 19:28:54 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-04-29 19:28:54 +0000
commitd4d99d281df184eed3c67063fe64b542a154a509 (patch)
tree8a7a30c4c4204e35d97821cc04fc225668d04f76 /src/Text/Pandoc/Readers/HTML.hs
parent59563e5fb17f4c224920f0fb14a06cf84c1cb86f (diff)
Made htmlComment parser more efficient.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1567 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 65e512b5e..c988c68d2 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -346,7 +346,9 @@ rawHtmlBlock' = do notFollowedBy' (htmlTag "/body" <|> htmlTag "/html")
htmlComment :: GenParser Char st [Char]
htmlComment = try $ do
string "<!--"
- comment <- manyTill anyChar (try (string "-->"))
+ comment <- many ( (satisfy (/='-'))
+ <|> (char '-' >>~ notFollowedBy (try $ char '-' >> char '>')))
+ string "-->"
return $ "<!--" ++ comment ++ "-->"
--