Skip to content

Commit

Permalink
Fix #466
Browse files Browse the repository at this point in the history
  • Loading branch information
yuin committed Oct 12, 2024
1 parent fe34ea5 commit fa88006
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions _test/extra.txt
Original file line number Diff line number Diff line change
Expand Up @@ -794,3 +794,18 @@ text" /></p>
//- - - - - - - - -//
<p><a href="b"><em>[a]</em></a></p>
//= = = = = = = = = = = = = = = = = = = = = = = =//

64: Nested list under an empty list item
//- - - - - - - - -//
-
- foo
//- - - - - - - - -//
<ul>
<li>
<ul>
<li>foo</li>
</ul>
</li>
</ul>
//= = = = = = = = = = = = = = = = = = = = = = = =//

2 changes: 1 addition & 1 deletion parser/list_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context)
}

offset := lastOffset(node.Parent())
isEmpty := node.ChildCount() == 0
isEmpty := node.ChildCount() == 0 && pc.Get(emptyListItemWithBlankLines) != nil
indent, _ := util.IndentWidth(line, reader.LineOffset())
if (isEmpty || indent < offset) && indent < 4 {
_, typ := matchesListItem(line, true)
Expand Down

0 comments on commit fa88006

Please sign in to comment.