This commit is contained in:
Vanessa 2022-08-06 18:01:20 +08:00
parent f7e34c0e71
commit 842e22fde6
4 changed files with 6 additions and 8 deletions

View file

@ -141,7 +141,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false) =>
tempElement.innerHTML = `<div${subType === "o" ? " data-marker=\"1.\"" : ""} data-subtype="${subType}" data-node-id="${Lute.NewNodeID()}" data-type="NodeList" class="list">${html}<div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`;
}
}
let lastElement: Element
let lastElement: Element;
Array.from(tempElement.content.children).reverse().forEach((item) => {
const addId = item.getAttribute("data-node-id");
if (addId === id) {
@ -192,7 +192,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false) =>
// https://github.com/siyuan-note/siyuan/issues/5591
focusBlock(lastElement, undefined, false);
}
const wbrElement = protyle.wysiwyg.element.querySelector("wbr")
const wbrElement = protyle.wysiwyg.element.querySelector("wbr");
if (wbrElement) {
wbrElement.remove();
}