import { Pipe, PipeTransform, inject } from '@angular/core'
import { DomSanitizer, SafeHtml } from '@angular/platform-browser'

@Pipe({ name: 'sanitize' })
export class SanitizePipe implements PipeTransform {
	private readonly _sanitizer = inject(DomSanitizer)

	transform(html: string): SafeHtml {
		return this._sanitizer.bypassSecurityTrustHtml(html)
	}
}
