MCPcopy Create free account
hub / github.com/angular/angular / ɵɵsanitizeHtml

Function ɵɵsanitizeHtml

packages/core/src/sanitization/sanitization.ts:49–58  ·  view source on GitHub ↗
(unsafeHtml: any)

Source from the content-addressed store, hash-verified

47 * @codeGenApi
48 */
49export function ɵɵsanitizeHtml(unsafeHtml: any): TrustedHTML | string {
50 const sanitizer = getSanitizer();
51 if (sanitizer) {
52 return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || '');
53 }
54 if (allowSanitizationBypassAndThrow(unsafeHtml, BypassType.Html)) {
55 return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml));
56 }
57 return _sanitizeHtml(getDocument(), renderStringify(unsafeHtml));
58}
59
60/**
61 * A `style` sanitizer which converts untrusted `style` **string** into trusted string by removing

Callers 1

Calls 8

unwrapSafeValueFunction · 0.90
_sanitizeHtmlFunction · 0.90
getDocumentFunction · 0.90
renderStringifyFunction · 0.90
getSanitizerFunction · 0.85
sanitizeMethod · 0.45

Tested by

no test coverage detected