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.
This commit is contained in:
parent
fd7e3cb18f
commit
fb6e5812bc
2 changed files with 11 additions and 2 deletions
|
@ -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, "")
|
||||
|
|
8
test/command/4019.md
Normal file
8
test/command/4019.md
Normal file
|
@ -0,0 +1,8 @@
|
|||
```
|
||||
pandoc --wrap=preserve
|
||||
This <!-- x > 0 --> works!
|
||||
This <!-- x > 0 --> fails?
|
||||
^D
|
||||
<p>This <!-- x > 0 --> works!
|
||||
This <!-- x > 0 --> fails?</p>
|
||||
```
|
Loading…
Add table
Reference in a new issue