1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Add hyperlink video timestamps in description

Fix #1312 (duplicates: #1728 and #2007)
The modification is also applied to comments and video editing.
This commit is contained in:
Lesterpig 2019-10-02 21:17:10 +02:00 committed by Chocobozzz
parent a0dedc02ca
commit d68ebf0b4a
5 changed files with 24 additions and 10 deletions

View file

@ -27,6 +27,7 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
@Input() previewColumn = false
@Input() truncate: number
@Input() markdownType: 'text' | 'enhanced' = 'text'
@Input() markdownVideo = false
textareaMarginRight = '0'
flexDirection = 'column'
@ -89,9 +90,11 @@ export class MarkdownTextareaComponent implements ControlValueAccessor, OnInit {
this.previewHTML = await this.markdownRender(this.content)
}
private markdownRender (text: string) {
if (this.markdownType === 'text') return this.markdownService.textMarkdownToHTML(text)
private async markdownRender (text: string) {
const html = this.markdownType === 'text' ?
await this.markdownService.textMarkdownToHTML(text) :
await this.markdownService.enhancedMarkdownToHTML(text)
return this.markdownService.enhancedMarkdownToHTML(text)
return this.markdownVideo ? this.markdownService.processVideoTimestamps(html) : html
}
}