https://github.com/angular/angular
Raw File
Tip revision: 938d7a65f65e77b65c0d40919de97547f0305b3a authored by Alex Rickabaugh on 02 August 2023, 19:38:15 UTC
release: cut the v16.1.8 release
Tip revision: 938d7a6
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