feat(import/markdown): normalize non-breaking spaces

This commit is contained in:
Elian Doran
2025-04-03 19:29:51 +03:00
parent 99461dbf7e
commit 32db26684d
3 changed files with 27 additions and 0 deletions

View File

@@ -87,6 +87,9 @@ function renderToHtml(content: string, title: string) {
// Remove slash for self-closing tags to match CKEditor's approach.
html = html.replace(/<(\w+)([^>]*)\s+\/>/g, "<$1$2>");
// Normalize non-breaking spaces to entity.
html = html.replaceAll("\u00a0", "&nbsp;");
return html;
}