import { Injectable } from '@angular/core'
import { LinkifierService } from '@app/shared/renderer/linkifier.service'
-import * as sanitizeHtml from 'sanitize-html'
@Injectable()
export class HtmlRendererService {
}
- toSafeHtml (text: string) {
+ async toSafeHtml (text: string) {
+ // FIXME: import('..') returns a struct module, containing a "default" field corresponding to our sanitizeHtml function
+ const sanitizeHtml: typeof import ('sanitize-html') = (await import('sanitize-html') as any).default
+
// Convert possible markdown to html
const html = this.linkifier.linkify(text)