Skip to content

Commit 5799be7

Browse files
committed
Fix bug w/ lists collapsing into thematic breaks
Related-to: 18bc860.
1 parent 7e5639e commit 5799be7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

lib/handle/list.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ export function list(node, parent, context) {
6363
// That are each the first child.
6464
context.indexStack[context.indexStack.length - 1] === 0 &&
6565
context.indexStack[context.indexStack.length - 2] === 0 &&
66-
context.indexStack[context.indexStack.length - 3] === 0 &&
67-
context.indexStack[context.indexStack.length - 4] === 0
66+
context.indexStack[context.indexStack.length - 3] === 0
6867
) {
6968
useDifferentMarker = true
7069
}

test/index.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2690,7 +2690,19 @@ test('listItem', (t) => {
26902690
t.equal(
26912691
to(createList(createList(createList()))),
26922692
'* * -\n',
2693-
'should use a different bullet for an empty list item in three lists'
2693+
'should use a different bullet for an empty list item in three lists (1)'
2694+
)
2695+
2696+
t.equal(
2697+
to({
2698+
type: 'list',
2699+
children: [
2700+
{type: 'listItem', children: []},
2701+
{type: 'listItem', children: [createList(createList())]}
2702+
]
2703+
}),
2704+
'*\n\n* * -\n',
2705+
'should use a different bullet for an empty list item in three lists (2)'
26942706
)
26952707

26962708
t.equal(

0 commit comments

Comments
 (0)