mirror of
https://github.com/yuin/goldmark
synced 2025-03-04 23:04:52 +00:00
Fix #287
This commit is contained in:
parent
0af271269f
commit
e64a68fc13
2 changed files with 6 additions and 1 deletions
|
|
@ -708,6 +708,11 @@ This line will be displayed.
|
|||
55: inline HTML comment
|
||||
//- - - - - - - - -//
|
||||
a <!-- b --> c
|
||||
|
||||
a <!-- b -->
|
||||
//- - - - - - - - -//
|
||||
<p>a <!-- b --> c</p>
|
||||
<p>a <!-- b --></p>
|
||||
//= = = = = = = = = = = = = = = = = = = = = = = =//
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ func (s *rawHTMLParser) parseComment(block text.Reader, pc Context) ast.Node {
|
|||
}
|
||||
index := bytes.Index(line, closeComment) + offset
|
||||
if index > -1 && hindex == index {
|
||||
if index == 0 || len(line) < 2 || line[index-1] != '-' {
|
||||
if index == 0 || len(line) < 2 || line[index-offset-1] != '-' {
|
||||
node.Segments.Append(segment.WithStop(segment.Start + index + len(closeComment)))
|
||||
block.Advance(index + len(closeComment))
|
||||
return node
|
||||
|
|
|
|||
Loading…
Reference in a new issue