This commit is contained in:
Vanessa 2023-08-08 13:26:25 +08:00
parent 95c0955735
commit 25dd919cf5

View file

@ -30,7 +30,8 @@ export const getLastBlock = (element: Element) => {
export const getFirstBlock = (element: Element) => {
let firstElement;
Array.from(element.querySelectorAll("[data-node-id]")).find(item => {
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed") && !item.classList.contains("li")) {
if (!hasClosestByAttribute(item.parentElement, "data-type", "NodeBlockQueryEmbed") &&
!item.classList.contains("li") && !item.classList.contains("sb")) {
firstElement = item;
return true;
}
@ -187,7 +188,7 @@ export const getNextFileLi = (current: Element) => {
nextElement = nextElement.parentElement;
} else if (nextElement.nextElementSibling.tagName === "LI") {
return nextElement.nextElementSibling;
} else if (nextElement.nextElementSibling.tagName === "UL") {
} else if (nextElement.nextElementSibling.tagName === "UL") {
return nextElement.nextElementSibling.firstElementChild;
}
}