Skip to content

Commit fa88006

Browse files
committed
Fix #466
1 parent fe34ea5 commit fa88006

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

_test/extra.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,3 +794,18 @@ text" /></p>
794794
//- - - - - - - - -//
795795
<p><a href="b"><em>[a]</em></a></p>
796796
//= = = = = = = = = = = = = = = = = = = = = = = =//
797+
798+
64: Nested list under an empty list item
799+
//- - - - - - - - -//
800+
-
801+
- foo
802+
//- - - - - - - - -//
803+
<ul>
804+
<li>
805+
<ul>
806+
<li>foo</li>
807+
</ul>
808+
</li>
809+
</ul>
810+
//= = = = = = = = = = = = = = = = = = = = = = = =//
811+

parser/list_item.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func (b *listItemParser) Continue(node ast.Node, reader text.Reader, pc Context)
5858
}
5959

6060
offset := lastOffset(node.Parent())
61-
isEmpty := node.ChildCount() == 0
61+
isEmpty := node.ChildCount() == 0 && pc.Get(emptyListItemWithBlankLines) != nil
6262
indent, _ := util.IndentWidth(line, reader.LineOffset())
6363
if (isEmpty || indent < offset) && indent < 4 {
6464
_, typ := matchesListItem(line, true)

0 commit comments

Comments
 (0)