fix: support nested ordered lists in collapse plugin (#764)
This commit is contained in:
parent
41d2a81a09
commit
bba98984d6
@ -54,12 +54,12 @@ function parseCollapse(tokens: Token[], index: number, attrs: CollapseMeta): num
|
||||
break
|
||||
}
|
||||
// 列表层级追踪
|
||||
if (token.type === 'bullet_list_open') {
|
||||
if (token.type === 'bullet_list_open' || token.type === 'ordered_list_open') {
|
||||
listStack.push(0) // 每个新列表初始层级为0
|
||||
if (listStack.length === 1)
|
||||
token.hidden = true
|
||||
}
|
||||
else if (token.type === 'bullet_list_close') {
|
||||
else if (token.type === 'bullet_list_close' || token.type === 'ordered_list_close') {
|
||||
listStack.pop()
|
||||
if (listStack.length === 0)
|
||||
token.hidden = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user