chore: introduce HTMLBuilder (#37688)

This commit is contained in:
wxiaoguang authored and GitHub committed 2026-05-13 17:06:53 +00:00
1 parent 701908a945
commit 523822090c
6 files changed
+47 -12

No files matched your search

+2 -1
View File
@@ -77,6 +77,7 @@ func (r *RenderInternal) ProtectSafeAttrs(content template.HTML) template.HTML {
}
func (r *RenderInternal) FormatWithSafeAttrs(w io.Writer, fmt template.HTML, a ...any) error {
_, err := w.Write([]byte(r.ProtectSafeAttrs(htmlutil.HTMLFormat(fmt, a...))))
htmlStr := r.ProtectSafeAttrs(htmlutil.HTMLFormat(fmt, a...))
_, err := io.WriteString(w, string(htmlStr))
return err
}