diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-18 11:19:10 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-18 11:19:10 +0200 |
commit | 53055a1124cbc2eaeeeeef21b19b0b46e96f23c5 (patch) | |
tree | d761c9928d2568937fad9a2316f7ad2b8b223f07 /client/src/app/videos | |
parent | 4d089429fe91ab7793b9b05010acb483d61345de (diff) | |
download | PeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.tar.gz PeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.tar.zst PeerTube-53055a1124cbc2eaeeeeef21b19b0b46e96f23c5.zip |
Handle markdown in account/video channel pages
Diffstat (limited to 'client/src/app/videos')
3 files changed, 5 insertions, 12 deletions
diff --git a/client/src/app/videos/+video-watch/modal/video-support.component.ts b/client/src/app/videos/+video-watch/modal/video-support.component.ts index f805215b9..c515298a0 100644 --- a/client/src/app/videos/+video-watch/modal/video-support.component.ts +++ b/client/src/app/videos/+video-watch/modal/video-support.component.ts | |||
@@ -23,11 +23,7 @@ export class VideoSupportComponent { | |||
23 | show () { | 23 | show () { |
24 | this.modal.show() | 24 | this.modal.show() |
25 | 25 | ||
26 | if (this.video.support) { | 26 | this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support) |
27 | this.videoHTMLSupport = this.markdownService.enhancedMarkdownToHTML(this.video.support) | ||
28 | } else { | ||
29 | this.videoHTMLSupport = '' | ||
30 | } | ||
31 | } | 27 | } |
32 | 28 | ||
33 | hide () { | 29 | hide () { |
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 6f6bd4e5d..8adf97d48 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -290,11 +290,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
290 | } | 290 | } |
291 | 291 | ||
292 | private setVideoDescriptionHTML () { | 292 | private setVideoDescriptionHTML () { |
293 | if (!this.video.description) { | ||
294 | this.videoHTMLDescription = '' | ||
295 | return | ||
296 | } | ||
297 | |||
298 | this.videoHTMLDescription = this.markdownService.textMarkdownToHTML(this.video.description) | 293 | this.videoHTMLDescription = this.markdownService.textMarkdownToHTML(this.video.description) |
299 | } | 294 | } |
300 | 295 | ||
diff --git a/client/src/app/videos/shared/markdown.service.ts b/client/src/app/videos/shared/markdown.service.ts index 681140087..14eeba777 100644 --- a/client/src/app/videos/shared/markdown.service.ts +++ b/client/src/app/videos/shared/markdown.service.ts | |||
@@ -23,14 +23,16 @@ export class MarkdownService { | |||
23 | } | 23 | } |
24 | 24 | ||
25 | textMarkdownToHTML (markdown: string) { | 25 | textMarkdownToHTML (markdown: string) { |
26 | const html = this.textMarkdownIt.render(markdown) | 26 | if (!markdown) return '' |
27 | 27 | ||
28 | const html = this.textMarkdownIt.render(markdown) | ||
28 | return this.avoidTruncatedLinks(html) | 29 | return this.avoidTruncatedLinks(html) |
29 | } | 30 | } |
30 | 31 | ||
31 | enhancedMarkdownToHTML (markdown: string) { | 32 | enhancedMarkdownToHTML (markdown: string) { |
32 | const html = this.enhancedMarkdownIt.render(markdown) | 33 | if (!markdown) return '' |
33 | 34 | ||
35 | const html = this.enhancedMarkdownIt.render(markdown) | ||
34 | return this.avoidTruncatedLinks(html) | 36 | return this.avoidTruncatedLinks(html) |
35 | } | 37 | } |
36 | 38 | ||