feat(import/markdown): preserve trailing semicolon in figure style

This commit is contained in:
Elian Doran
2025-04-05 12:37:06 +03:00
parent 8cb10764b6
commit cdb5ebb080
2 changed files with 3 additions and 3 deletions

View File

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