This commit is contained in:
parent
0f6d14a243
commit
9d740f26c1
1 changed files with 3 additions and 2 deletions
|
@ -219,9 +219,10 @@ export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle
|
|||
// 回车之前的块为 1\n\n2 时会产生多个块
|
||||
Array.from(enterElement.children).forEach((item: HTMLElement) => {
|
||||
if (item.dataset.nodeId === id) {
|
||||
const previousElement = blockElement.previousElementSibling;
|
||||
const blockPreviousElement = blockElement.previousElementSibling;
|
||||
const blockParentElement = blockElement.parentElement;
|
||||
blockElement.outerHTML = item.outerHTML;
|
||||
blockElement = (previousElement?.nextElementSibling || protyle.wysiwyg.element.firstElementChild) as HTMLElement;
|
||||
blockElement = (blockPreviousElement ? blockPreviousElement.nextElementSibling : blockParentElement.firstElementChild) as HTMLElement;
|
||||
doOperation.push({
|
||||
action: "update",
|
||||
data: blockElement.outerHTML,
|
||||
|
|
Loading…
Add table
Reference in a new issue