Sanitize upon saving

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-03-30 17:52:25 +04:00
parent 62e68dfb6f
commit f3982f23f9
23 changed files with 471 additions and 356 deletions

View File

@@ -561,7 +561,7 @@ func (c *htmlBlockConverter) convertAnchor(n *html.Node) ([]Node, error) {
if t := attrVal(n, "title"); t != "" {
title = &t
}
attrs, err := json.Marshal(LinkAttrs{Href: href, Title: title})
attrs, err := json.Marshal(LinkAttrs{Href: safeLinkHref(href), Title: title})
if err != nil {
return nil, fmt.Errorf("cannot marshal link attrs: %w", err)
}