Fix editor HTML beautification in incorrectly adding breaks to links.

Closes #655
This commit is contained in:
Kailash Nadh 2022-01-30 21:43:23 +05:30
parent 6a5ed43275
commit 636db204fc

View file

@ -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');