]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/renderer/html-renderer.service.ts
Fix infinite scroll on big screens
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / renderer / html-renderer.service.ts
index d49df9b6d9a7c6e9ca2262982dbb1683fbabdd2c..28ef51e727b51be1d3e5d20f7cacb02f69a1b135 100644 (file)
@@ -1,6 +1,5 @@
 import { Injectable } from '@angular/core'
 import { LinkifierService } from '@app/shared/renderer/linkifier.service'
-import * as sanitizeHtml from 'sanitize-html'
 
 @Injectable()
 export class HtmlRendererService {
@@ -9,7 +8,10 @@ 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)