summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/HTML.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-10-31 21:13:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-10-31 21:14:38 -0700
commitfb6e5812bce4c71d6ac9a8946f0d69d4c08820de (patch)
tree563a5df00eba487b47f63b1c17fd9c4e0ce93a72 /src/Text/Pandoc/Readers/HTML.hs
parentfd7e3cb18f55e05795180b782a1b61dc602b6ac4 (diff)
Fixed regression in parsing of HTML comments in markdown...
and other non-HTML formats (`Text.Pandoc.Readers.HTML.htmlTag`). The parser stopped at the first `>` character, even if it wasn't the end of the comment. Closes #4019.
Diffstat (limited to 'src/Text/Pandoc/Readers/HTML.hs')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 8d37deb26..915fa852f 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -1172,8 +1172,9 @@ htmlTag f = try $ do
case next of
TagComment s
| "<!--" `isPrefixOf` inp -> do
- char '<'
- manyTill anyChar endAngle
+ string "<!--"
+ count (length s) anyChar
+ string "-->"
stripComments <- getOption readerStripComments
if stripComments
then return (next, "")