feat(import/markdown): preserve trailing semicolon in img

This commit is contained in:
Elian Doran
2025-04-05 12:31:02 +03:00
parent 64ccea5702
commit 8cb10764b6
2 changed files with 4 additions and 1 deletions

View File

@@ -99,6 +99,9 @@ function renderToHtml(content: string, title: string) {
html = importUtils.handleH1(html, title);
html = htmlSanitizer.sanitize(html);
// Add a trailing semicolon to CSS styles.
html = html.replaceAll(/(<img style=".*?)"/g, "$1;\"");
// Remove slash for self-closing tags to match CKEditor's approach.
html = html.replace(/<(\w+)([^>]*)\s+\/>/g, "<$1$2>");