Skip to content

Commit

Permalink
Fix #361
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Feb 2, 2023
1 parent 550b0c7 commit 82ff890
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
11 changes: 11 additions & 0 deletions _test/extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -741,3 +741,14 @@ a <!-- b -->
</li>
</ol>
//= = = = = = = = = = = = = = = = = = = = = = = =//


58: HTML end tag without trailing new lines
OPTIONS: {"trim": true}
//- - - - - - - - -//
<pre>
</pre>
//- - - - - - - - -//
<pre>
</pre>
//= = = = = = = = = = = = = = = = = = = = = = = =//
6 changes: 3 additions & 3 deletions parser/html_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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:
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 82ff890

Please sign in to comment.