Browse Source

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

Vanessa 1 year ago
parent
commit
a816dd3d27
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/ts/wysiwyg/index.ts

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

@@ -395,6 +395,10 @@ class WYSIWYG {
                 }
                 }
                 return;
                 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);
             input(vditor, range, event);
         });
         });