From d4d99d281df184eed3c67063fe64b542a154a509 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Wed, 29 Apr 2009 19:28:54 +0000 Subject: Made htmlComment parser more efficient. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1567 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/HTML.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Text') 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 <- many ( (satisfy (/='-')) + <|> (char '-' >>~ notFollowedBy (try $ char '-' >> char '>'))) + string "-->" return $ "" -- -- cgit v1.2.3