Renders untrusted HTML safely — keeping SVG and richer markup — for use with
[innerHTML]. Sanitizes with DOMPurify (HTML + SVG profiles) and then wraps
the cleaned string with bypassSecurityTrustHtml, so Angular doesn't strip
the now-safe SVG/styles a second time.
Pure pipe → Angular memoizes by input value, so it only re-sanitizes when the
string actually changes (cheap under OnPush).
Renders untrusted HTML safely — keeping SVG and richer markup — for use with
[innerHTML]. Sanitizes with DOMPurify (HTML + SVG profiles) and then wraps the cleaned string withbypassSecurityTrustHtml, so Angular doesn't strip the now-safe SVG/styles a second time.Pure pipe → Angular memoizes by input value, so it only re-sanitizes when the string actually changes (cheap under OnPush).
Example