remove extra breaks

This commit is contained in:
ngn 2023-06-11 20:41:55 +03:00 committed by GitHub
parent 16838bf256
commit 497057c892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,7 @@ export default {
if (res.data["error"] === 3) if (res.data["error"] === 3)
return this.$router.push({ path: "/blog" }) return this.$router.push({ path: "/blog" })
this.post = res.data["post"] this.post = res.data["post"]
this.post["content"] = this.post["content"].replaceAll("\n<br>\n<br>\n", "\n")
this.content = DOMPurify.sanitize( this.content = DOMPurify.sanitize(
marked.parse(this.post["content"], { breaks: true }), marked.parse(this.post["content"], { breaks: true }),
{ ADD_TAGS: ["iframe"], ADD_ATTR: ['allow', 'allowfullscreen', 'frameborder', 'scrolling'] } { ADD_TAGS: ["iframe"], ADD_ATTR: ['allow', 'allowfullscreen', 'frameborder', 'scrolling'] }