Skip to content

Commit

Permalink
Fix editor HTML beautification in incorrectly adding breaks to links.
Browse files Browse the repository at this point in the history
Closes #655
  • Loading branch information
knadh committed Jan 30, 2022
1 parent 6a5ed43 commit 636db20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 636db20

Please sign in to comment.