diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 807c88ade..007763305 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -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, diff --git a/frontend/src/app/shared/pipes/no-sanitize.pipe.ts b/frontend/src/app/shared/pipes/no-sanitize.pipe.ts new file mode 100644 index 000000000..039eafb76 --- /dev/null +++ b/frontend/src/app/shared/pipes/no-sanitize.pipe.ts @@ -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); + } +}