Skip to content

Commit

Permalink
fix: empty div as block element
Browse files Browse the repository at this point in the history
KillerCodeMonkey committed Oct 21, 2019
1 parent 90464db commit 0e11cdd
Showing 3 changed files with 31 additions and 41 deletions.
64 changes: 27 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/components/quill-editor.tsx
Original file line number Diff line number Diff line change
@@ -122,7 +122,7 @@ export class QuillEditorComponent implements ComponentDidLoad, ComponentDidUnloa
const content = this.quillEditor.getContents();

let html: string | null = this.editorElement.children[0].innerHTML;
if (html === '<p><br></p>' || html === '<div><br><div>') {
if (html === '<p><br></p>' || html === '<div><br></div>') {
html = '';
}

@@ -186,7 +186,7 @@ export class QuillEditorComponent implements ComponentDidLoad, ComponentDidUnloa
const content = this.quillEditor.getContents()

let html: string | null = this.editorElement.querySelector('.ql-editor')!.innerHTML
if (html === '<p><br></p>' || html === '<div><br><div>') {
if (html === '<p><br></p>' || html === '<div><br></div>') {
html = null
}

@@ -243,7 +243,7 @@ export class QuillEditorComponent implements ComponentDidLoad, ComponentDidUnloa
const content = this.quillEditor.getContents();

let html: string | null = this.editorElement.querySelector('.ql-editor').innerHTML;
if (html === '<p><br></p>' || html === '<div><br><div>') {
if (html === '<p><br></p>' || html === '<div><br></div>') {
html = null;
}

2 changes: 1 addition & 1 deletion src/components/quill-view.tsx
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ export class QuillViewComponent implements ComponentDidLoad {
const content = this.quillEditor.getContents();

let html: string | null = this.editorElement.children[0].innerHTML;
if (html === '<p><br></p>' || html === '<div><br><div>') {
if (html === '<p><br></p>' || html === '<div><br></div>') {
html = '';
}

0 comments on commit 0e11cdd

Please sign in to comment.