diff options
| author | Bobby <[email protected]> | 2022-09-20 20:29:17 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-09-20 20:29:17 -0400 |
| commit | b2c18e009367a68acf22e494ceb3ec8c4acffcb5 (patch) | |
| tree | 23ea8dfea63860abce5780f0f3fec025ca8365c9 /templates | |
| parent | 2dc46b1911f65fdba0df4b9f541ed77f2d713c3e (diff) | |
| download | thatcomputerscientist-b2c18e009367a68acf22e494ceb3ec8c4acffcb5.tar.xz thatcomputerscientist-b2c18e009367a68acf22e494ceb3ec8c4acffcb5.zip | |
Fixed empty spaces around formula and blog article
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/blog_admin/edit_post.html | 8 | ||||
| -rw-r--r-- | templates/blog_admin/new_post.html | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/templates/blog_admin/edit_post.html b/templates/blog_admin/edit_post.html index 09bba62c..c221917d 100644 --- a/templates/blog_admin/edit_post.html +++ b/templates/blog_admin/edit_post.html @@ -125,7 +125,7 @@ static create(value) { const node = super.create(value); if (typeof value === "string") { - node.innerHTML = "" + this.tex2svg(value) + ""; + node.innerHTML = "" + this.tex2svg(value) + ""; node.contentEditable = "false"; node.setAttribute("data-value", value); } @@ -152,7 +152,7 @@ static create(value) { const node = super.create(value); if (typeof value === "string") { - node.innerHTML = "" + this.tex2svg(value) + ""; + node.innerHTML = "" + this.tex2svg(value) + ""; node.contentEditable = "false"; node.setAttribute("data-value", value); } @@ -244,7 +244,9 @@ }); try { - const delta = quill.clipboard.convert(document.getElementById("body").value); + const value = document.getElementById("body").value; + const newValue = value.replace(/<p><br><\/p>/g, ""); + const delta = quill.clipboard.convert(value); quill.setContents(delta, "silent"); } catch (e) { console.log(e); diff --git a/templates/blog_admin/new_post.html b/templates/blog_admin/new_post.html index 8d05d7b9..807d9d9a 100644 --- a/templates/blog_admin/new_post.html +++ b/templates/blog_admin/new_post.html @@ -125,7 +125,7 @@ static create(value) { const node = super.create(value); if (typeof value === "string") { - node.innerHTML = "" + this.tex2svg(value) + ""; + node.innerHTML = "" + this.tex2svg(value) + ""; node.contentEditable = "false"; node.setAttribute("data-value", value); } @@ -152,7 +152,7 @@ static create(value) { const node = super.create(value); if (typeof value === "string") { - node.innerHTML = "" + this.tex2svg(value) + ""; + node.innerHTML = "" + this.tex2svg(value) + ""; node.contentEditable = "false"; node.setAttribute("data-value", value); } @@ -244,7 +244,9 @@ }); try { - const delta = quill.clipboard.convert(document.getElementById("body").value); + const value = document.getElementById("body").value; + const newValue = value.replace(/<p><br><\/p>/g, ""); + const delta = quill.clipboard.convert(value); quill.setContents(delta, "silent"); } catch (e) { console.log(e); |
