From 636db204fcf03f2a2e7d3c8dfbeb0402dffe81b8 Mon Sep 17 00:00:00 2001 From: Kailash Nadh Date: Sun, 30 Jan 2022 21:43:23 +0530 Subject: [PATCH] Fix editor HTML beautification in incorrectly adding breaks to links. Closes #655 --- frontend/src/components/Editor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Editor.vue b/frontend/src/components/Editor.vue index a0a333b6..54793f5a 100644 --- a/frontend/src/components/Editor.vue +++ b/frontend/src/components/Editor.vue @@ -375,7 +375,7 @@ export default { beautifyHTML(str) { // Pad all tags with linebreaks. - let s = this.trimLines(str.replace(/(<([^>]+)>)/ig, '\n$1\n'), true); + let s = this.trimLines(str.replace(/(<(?!(\/)?a|span)([^>]+)>)/ig, '\n$1\n'), true); // Remove extra linebreaks. s = s.replace(/\n+/g, '\n');