diff options
author | Lesterpig <git@lesterpig.com> | 2019-10-02 21:17:10 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-12-17 09:45:02 +0100 |
commit | d68ebf0b4a40f88e53a78de6b3109a41466fa7c6 (patch) | |
tree | bbe02b16b88351b354c99f959c888d36444e719c /client/src/app/shared/forms | |
parent | a0dedc02ca870a31298eb35d5105a1ebc34dbb4a (diff) | |
download | PeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.tar.gz PeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.tar.zst PeerTube-d68ebf0b4a40f88e53a78de6b3109a41466fa7c6.zip |
Add hyperlink video timestamps in description
Fix #1312 (duplicates: #1728 and #2007)
The modification is also applied to comments and video editing.
Diffstat (limited to 'client/src/app/shared/forms')
-rw-r--r-- | client/src/app/shared/forms/markdown-textarea.component.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/client/src/app/shared/forms/markdown-textarea.component.ts b/client/src/app/shared/forms/markdown-textarea.component.ts index 49a57f29d..0c5788899 100644 --- a/client/src/app/shared/forms/markdown-textarea.component.ts +++ b/client/src/app/shared/forms/markdown-textarea.component.ts | |||
@@ -27,6 +27,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
27 | @Input() previewColumn = false | 27 | @Input() previewColumn = false |
28 | @Input() truncate: number | 28 | @Input() truncate: number |
29 | @Input() markdownType: 'text' | 'enhanced' = 'text' | 29 | @Input() markdownType: 'text' | 'enhanced' = 'text' |
30 | @Input() markdownVideo = false | ||
30 | 31 | ||
31 | textareaMarginRight = '0' | 32 | textareaMarginRight = '0' |
32 | flexDirection = 'column' | 33 | flexDirection = 'column' |
@@ -89,9 +90,11 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit { | |||
89 | this.previewHTML = await this.markdownRender(this.content) | 90 | this.previewHTML = await this.markdownRender(this.content) |
90 | } | 91 | } |
91 | 92 | ||
92 | private markdownRender (text: string) { | 93 | private async markdownRender (text: string) { |
93 | if (this.markdownType === 'text') return this.markdownService.textMarkdownToHTML(text) | 94 | const html = this.markdownType === 'text' ? |
95 | await this.markdownService.textMarkdownToHTML(text) : | ||
96 | await this.markdownService.enhancedMarkdownToHTML(text) | ||
94 | 97 | ||
95 | return this.markdownService.enhancedMarkdownToHTML(text) | 98 | return this.markdownVideo ? this.markdownService.processVideoTimestamps(html) : html |
96 | } | 99 | } |
97 | } | 100 | } |