mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-02 23:40:04 +00:00
Lexical: Fixed task list parsing
Updated list DOM parsing to properly consider task list format set by other MD/WYSIWYG editors.
This commit is contained in:
parent
5c6671b3bf
commit
c03e44124a
1 changed files with 13 additions and 1 deletions
|
@ -332,7 +332,19 @@ function isDomChecklist(domNode: HTMLElement) {
|
||||||
}
|
}
|
||||||
// if children are checklist items, the node is a checklist ul. Applicable for googledoc checklist pasting.
|
// if children are checklist items, the node is a checklist ul. Applicable for googledoc checklist pasting.
|
||||||
for (const child of domNode.childNodes) {
|
for (const child of domNode.childNodes) {
|
||||||
if (isHTMLElement(child) && child.hasAttribute('aria-checked')) {
|
if (!isHTMLElement(child)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child.hasAttribute('aria-checked')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child.classList.contains('task-list-item')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (child.firstElementChild && child.firstElementChild.matches('input[type="checkbox"]')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue