Skip to content

Commit

Permalink
🎨 #11391
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed May 17, 2024
1 parent 1c45347 commit 0ad0d41
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/src/protyle/wysiwyg/commonHotkey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,15 @@ export const duplicateBlock = (nodeElements: Element[], protyle: IProtyle) => {
childItem.setAttribute("data-node-id", Lute.NewNodeID());
});
item.classList.remove("protyle-wysiwyg--select");
nodeElements[0].after(tempElement);
if (tempElement.dataset.type ==="NodeHTMLBlock") {
const phElement = tempElement.querySelector("protyle-html");
const content = phElement.getAttribute("data-content");
phElement.setAttribute("data-content", "");
nodeElements[0].after(tempElement);
phElement.setAttribute("data-content", Lute.UnEscapeHTMLStr(content));
} else {
nodeElements[0].after(tempElement);
}
doOperations.push({
action: "insert",
data: tempElement.outerHTML,
Expand Down

0 comments on commit 0ad0d41

Please sign in to comment.