unsafe-svg.js 793 B

123456789101112131415161718192021222324
  1. /**
  2. * @license
  3. * Copyright 2017 Google LLC
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. import { directive } from '../directive.js';
  7. import { UnsafeHTMLDirective } from './unsafe-html.js';
  8. const SVG_RESULT = 2;
  9. class UnsafeSVGDirective extends UnsafeHTMLDirective {
  10. }
  11. UnsafeSVGDirective.directiveName = 'unsafeSVG';
  12. UnsafeSVGDirective.resultType = SVG_RESULT;
  13. /**
  14. * Renders the result as SVG, rather than text.
  15. *
  16. * The values `undefined`, `null`, and `nothing`, will all result in no content
  17. * (empty string) being rendered.
  18. *
  19. * Note, this is unsafe to use with any user-provided input that hasn't been
  20. * sanitized or escaped, as it may lead to cross-site-scripting
  21. * vulnerabilities.
  22. */
  23. export const unsafeSVG = directive(UnsafeSVGDirective);
  24. //# sourceMappingURL=unsafe-svg.js.map