diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-04-29 19:28:54 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2009-04-29 19:28:54 +0000 |
commit | d4d99d281df184eed3c67063fe64b542a154a509 (patch) | |
tree | 8a7a30c4c4204e35d97821cc04fc225668d04f76 /src | |
parent | 59563e5fb17f4c224920f0fb14a06cf84c1cb86f (diff) | |
download | pandoc-d4d99d281df184eed3c67063fe64b542a154a509.tar.gz |
Made htmlComment parser more efficient.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1567 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/HTML.hs | 4 |
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 ++ "-->" -- |