This commit is contained in:
yuin 2023-02-02 21:02:21 +09:00
parent 550b0c7ca0
commit 82ff890073
2 changed files with 14 additions and 3 deletions

View file

@ -741,3 +741,14 @@ a <!-- b -->
</li>
</ol>
//= = = = = = = = = = = = = = = = = = = = = = = =//
58: HTML end tag without trailing new lines
OPTIONS: {"trim": true}
//- - - - - - - - -//
<pre>
</pre>
//- - - - - - - - -//
<pre>
</pre>
//= = = = = = = = = = = = = = = = = = = = = = = =//

View file

@ -149,7 +149,7 @@ func (b *htmlBlockParser) Open(parent ast.Node, reader text.Reader, pc Context)
}
}
if node != nil {
reader.Advance(segment.Len() - 1)
reader.Advance(segment.Len() - util.TrimRightSpaceLength(line))
node.Lines().Append(segment)
return node, NoChildren
}
@ -172,7 +172,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context
}
if htmlBlockType1CloseRegexp.Match(line) {
htmlBlock.ClosureLine = segment
reader.Advance(segment.Len() - 1)
reader.Advance(segment.Len() - util.TrimRightSpaceLength(line))
return Close
}
case ast.HTMLBlockType2:
@ -211,7 +211,7 @@ func (b *htmlBlockParser) Continue(node ast.Node, reader text.Reader, pc Context
}
}
node.Lines().Append(segment)
reader.Advance(segment.Len() - 1)
reader.Advance(segment.Len() - util.TrimRightSpaceLength(line))
return Continue | NoChildren
}