Fix html conversion of soft line breaks + rel attr for _blank link targets

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-30 18:37:50 +04:00
parent a461410fed
commit dda6e41102
5 changed files with 91 additions and 6 deletions

View File

@@ -26,12 +26,10 @@ import (
// htmlBlockSanitizePolicy matches tags and attributes we can represent as
// ProseMirror/Tiptap JSON and strips scripts, event handlers, and unsafe URLs.
func htmlBlockSanitizePolicy() *bluemonday.Policy {
return bluemonday.UGCPolicy()
}
var htmlBlockSanitizePolicy = bluemonday.UGCPolicy()
func sanitizeHTMLBlockContent(s string) string {
return htmlBlockSanitizePolicy().Sanitize(s)
return htmlBlockSanitizePolicy.Sanitize(s)
}
// convertProseMirrorFromInlineHTML sanitizes inline raw HTML and maps it to