mirror of
https://github.com/mempool/mempool.git
synced 2024-12-28 01:04:28 +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 { ApiDocsComponent } from './components/docs/api-docs.component';
|
||||||
import { DocsComponent } from './components/docs/docs.component';
|
import { DocsComponent } from './components/docs/docs.component';
|
||||||
import { ApiDocsNavComponent } from './components/docs/api-docs-nav.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 { CodeTemplateComponent } from './components/docs/code-template.component';
|
||||||
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
import { TermsOfServiceComponent } from './components/terms-of-service/terms-of-service.component';
|
||||||
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
|
import { PrivacyPolicyComponent } from './components/privacy-policy/privacy-policy.component';
|
||||||
@ -119,6 +120,7 @@ import { DataCyDirective } from './data-cy.directive';
|
|||||||
DashboardComponent,
|
DashboardComponent,
|
||||||
DifficultyComponent,
|
DifficultyComponent,
|
||||||
ApiDocsComponent,
|
ApiDocsComponent,
|
||||||
|
NoSanitizePipe,
|
||||||
CodeTemplateComponent,
|
CodeTemplateComponent,
|
||||||
TermsOfServiceComponent,
|
TermsOfServiceComponent,
|
||||||
PrivacyPolicyComponent,
|
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