Vanessa 2024-03-19 20:17:55 +08:00
parent 83fbf8c523
commit 521c7289b8

View file

@ -219,7 +219,9 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
// 回车之前的块为 1\n\n2 时会产生多个块
Array.from(enterElement.children).forEach((item: HTMLElement) => {
if (item.dataset.nodeId === id) {
editableElement.innerHTML = item.querySelector('[contenteditable="true"]').innerHTML;
const previousElement = blockElement.previousElementSibling;
blockElement.outerHTML = item.outerHTML;
blockElement = (previousElement?.nextElementSibling || protyle.wysiwyg.element.firstElementChild) as HTMLElement;
doOperation.push({
action: "update",
data: blockElement.outerHTML,