https://github.com/angular/angular
Raw File
Tip revision: 3eda005680efeec37da310c0fee8dff90cae0740 authored by Andrew Kushnir on 14 February 2024, 22:51:37 UTC
release: cut the v17.2.1 release
Tip revision: 3eda005
security.ts
import { htmlSafeByReview } from 'safevalues/restricted/reviewed';

export function fromInnerHTML(el: Element): TrustedHTML {
  // SECURITY: Existing innerHTML content is already trusted.
  return htmlSafeByReview(el.innerHTML, '^');
}

export function fromOuterHTML(el: Element): TrustedHTML {
  // SECURITY: Existing outerHTML content is already trusted.
  return htmlSafeByReview(el.outerHTML, '^');
}

export function svg(constantSvg: TemplateStringsArray): TrustedHTML {
  // SECURITY: Template literal argument with no interpolation is constant, and
  // hence trusted.
  return htmlSafeByReview(constantSvg[0], '^');
}
back to top