Переглянути джерело

: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);
         });