This commit is contained in:
Vanessa 2022-08-07 09:39:55 +08:00
parent 65821e57de
commit bedb811d6e

View File

@ -119,8 +119,8 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
} }
return; return;
} }
protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select").forEach(item => { protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select, .protyle-wysiwyg--hl").forEach(item => {
item.classList.remove("protyle-wysiwyg--select"); item.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
}); });
const code = processPasteCode(textHTML, textPlain); const code = processPasteCode(textHTML, textPlain);
const range = getEditorRange(protyle.wysiwyg.element); const range = getEditorRange(protyle.wysiwyg.element);
@ -189,7 +189,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
tempElement.innerHTML = textHTML.substr(1); tempElement.innerHTML = textHTML.substr(1);
let isBlock = false; let isBlock = false;
tempElement.querySelectorAll("[data-node-id]").forEach((e) => { tempElement.querySelectorAll("[data-node-id]").forEach((e) => {
e.classList.remove("protyle-wysiwyg--select"); e.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
isBlock = true; isBlock = true;
}); });
if (nodeElement.classList.contains("table")) { if (nodeElement.classList.contains("table")) {
@ -206,7 +206,7 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
tempElement.querySelectorAll("[data-node-id]").forEach((e) => { tempElement.querySelectorAll("[data-node-id]").forEach((e) => {
const newId = Lute.NewNodeID(); const newId = Lute.NewNodeID();
e.setAttribute("data-node-id", newId); e.setAttribute("data-node-id", newId);
e.classList.remove("protyle-wysiwyg--select"); e.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
if (e.getAttribute("updated")) { if (e.getAttribute("updated")) {
e.setAttribute("updated", newId.split("-")[0]); e.setAttribute("updated", newId.split("-")[0]);
} }