]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/sanitize-html.pipe.ts
import ceph 15.2.14
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / sanitize-html.pipe.ts
1 import { Pipe, PipeTransform, SecurityContext } from '@angular/core';
2 import { DomSanitizer, SafeValue } from '@angular/platform-browser';
3
4 @Pipe({
5 name: 'sanitizeHtml'
6 })
7 export class SanitizeHtmlPipe implements PipeTransform {
8 constructor(private domSanitizer: DomSanitizer) {}
9
10 transform(value: SafeValue | string | null): string | null {
11 return this.domSanitizer.sanitize(SecurityContext.HTML, value);
12 }
13 }