diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-19 16:23:19 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-19 16:23:19 +0100 |
commit | b355b394083aa4ea67a17e5c60e1d3e40f2defd9 (patch) | |
tree | cf3943b0463681b7846f0e852c78337dc7b9e570 /client/src/app/core/renderer/html-renderer.service.ts | |
parent | c4f7fe09cd014b0ec5c0d64fd320780c45461c06 (diff) | |
download | PeerTube-b355b394083aa4ea67a17e5c60e1d3e40f2defd9.tar.gz PeerTube-b355b394083aa4ea67a17e5c60e1d3e40f2defd9.tar.zst PeerTube-b355b394083aa4ea67a17e5c60e1d3e40f2defd9.zip |
Lazy load linkifier
Diffstat (limited to 'client/src/app/core/renderer/html-renderer.service.ts')
-rw-r--r-- | client/src/app/core/renderer/html-renderer.service.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/client/src/app/core/renderer/html-renderer.service.ts b/client/src/app/core/renderer/html-renderer.service.ts index 1fe91b96b..3176cf6a4 100644 --- a/client/src/app/core/renderer/html-renderer.service.ts +++ b/client/src/app/core/renderer/html-renderer.service.ts | |||
@@ -21,10 +21,12 @@ export class HtmlRendererService { | |||
21 | } | 21 | } |
22 | 22 | ||
23 | async toSafeHtml (text: string) { | 23 | async toSafeHtml (text: string) { |
24 | await this.loadSanitizeHtml() | 24 | const [ html ] = await Promise.all([ |
25 | // Convert possible markdown to html | ||
26 | this.linkifier.linkify(text), | ||
25 | 27 | ||
26 | // Convert possible markdown to html | 28 | this.loadSanitizeHtml() |
27 | const html = this.linkifier.linkify(text) | 29 | ]) |
28 | 30 | ||
29 | return this.sanitizeHtml(html, SANITIZE_OPTIONS) | 31 | return this.sanitizeHtml(html, SANITIZE_OPTIONS) |
30 | } | 32 | } |