We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4fa8d9a commit aa72548Copy full SHA for aa72548
src/task-lists-element.js
@@ -187,9 +187,9 @@ function syncDisabled(list: TaskListsElement) {
187
// lists in the container, not just task lists, are indexed to match the
188
// server-side Markdown parser's indexing.
189
function listIndex(list: Element): number {
190
- const container = list.parentElement
+ const container = list.closest('task-lists')
191
if (!container) throw new Error('parent not found')
192
- const top = Array.from(container.children).filter(el => el.nodeName === 'OL' || el.nodeName === 'UL')
+ const top = Array.from(container.querySelectorAll('ol, ul'))
193
return top.indexOf(list)
194
}
195
0 commit comments