I have a pipe that uses DomSanitizer to bypass HTML. It's bypassing it. But, it converts all attributes inside the element to lower case. The pipe looks like this:
@Pipe({
name: 'innerHTML'
})
export class InnerHTMLPipe implements PipeTransform {
constructor(private _sanitizer: DomSanitizer) { }
transform(value: any, args?: any): SafeHtml {
return this._sanitizer.bypassSecurityTrustHtml(value ? value : '');
}
}
The component that generates the string looks like this:
<div [innerHTML]="getProgress(data) | innerHTML"></div>
return `<span
matTooltipPosition="above"
matTooltip="blablabla">hello</span>`;
But the output ends up like this:
<div>
<span mattooltipposition="above" mattooltip="blablabla">hello</span>
</div>
How do I prevent DomSanitizer from changing the attributes and keep the attributes intact?