mirror of
https://github.com/mempool/mempool.git
synced 2024-12-27 08:44:26 +01:00
Add no-sanitize pipe
This commit is contained in:
parent
c6c335921c
commit
663cf100d1
@ -56,6 +56,7 @@ import { faFilter, faAngleDown, faAngleUp, faAngleRight, faAngleLeft, faBolt, fa
|
||||
import { ApiDocsComponent } from './components/docs/api-docs.component';
|
||||
import { DocsComponent } from './components/docs/docs.component';
|
||||
import { ApiDocsNavComponent } from './components/docs/api-docs-nav.component';
|
||||
import { NoSanitizePipe } from './shared/pipes/no-sanitize.pipe';
|
||||
import { CodeTemplateComponent } from './components/docs/code-template.component';
|
||||
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
||||
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
|
||||
@ -119,6 +120,7 @@ import { DataCyDirective } from './data-cy.directive';
|
||||
DashboardComponent,
|
||||
DifficultyComponent,
|
||||
ApiDocsComponent,
|
||||
NoSanitizePipe,
|
||||
CodeTemplateComponent,
|
||||
TermsOfServiceComponent,
|
||||
PrivacyPolicyComponent,
|
||||
|
11
frontend/src/app/shared/pipes/no-sanitize.pipe.ts
Normal file
11
frontend/src/app/shared/pipes/no-sanitize.pipe.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
|
||||
@Pipe({ name: 'noSanitize' })
|
||||
export class NoSanitizePipe implements PipeTransform {
|
||||
constructor(private domSanitizer: DomSanitizer) { }
|
||||
|
||||
transform(html: string): SafeHtml {
|
||||
return this.domSanitizer.bypassSecurityTrustHtml(html);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user