浏览代码

:art: fix https://github.com/Vanessa219/vditor/issues/1565

Vanessa 1 年之前
父节点
当前提交
a816dd3d27
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/ts/wysiwyg/index.ts

+ 4 - 0
src/ts/wysiwyg/index.ts

@@ -395,6 +395,10 @@ class WYSIWYG {
                 }
                 return;
             }
+            // https://github.com/Vanessa219/vditor/issues/1565
+            if (event.inputType === "insertParagraph" && this.element.innerHTML === '<p><br></p><p><br></p>') {
+                blockElement.previousElementSibling.remove();
+            }
 
             input(vditor, range, event);
         });