diff options
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.component.ts | 9 | ||||
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.component.ts b/client/src/app/videos/+video-watch/comment/video-comment.component.ts index 23ff20aad..d5e3ecc17 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.component.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.component.ts | |||
@@ -4,7 +4,7 @@ import { VideoCommentThreadTree } from '../../../../../../shared/models/videos/v | |||
4 | import { AuthService } from '../../../core/auth' | 4 | import { AuthService } from '../../../core/auth' |
5 | import { Video } from '../../../shared/video/video.model' | 5 | import { Video } from '../../../shared/video/video.model' |
6 | import { VideoComment } from './video-comment.model' | 6 | import { VideoComment } from './video-comment.model' |
7 | import { MarkdownService } from '@app/shared/renderer' | 7 | import { HtmlRendererService, MarkdownService } from '@app/shared/renderer' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-video-comment', | 10 | selector: 'my-video-comment', |
@@ -28,6 +28,7 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
28 | newParentComments: VideoComment[] = [] | 28 | newParentComments: VideoComment[] = [] |
29 | 29 | ||
30 | constructor ( | 30 | constructor ( |
31 | private htmlRenderer: HtmlRendererService, | ||
31 | private markdownService: MarkdownService, | 32 | private markdownService: MarkdownService, |
32 | private authService: AuthService | 33 | private authService: AuthService |
33 | ) {} | 34 | ) {} |
@@ -78,7 +79,7 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
78 | } | 79 | } |
79 | 80 | ||
80 | isRemovableByUser () { | 81 | isRemovableByUser () { |
81 | return this.comment.account && this.isUserLoggedIn() && | 82 | return this.isUserLoggedIn() && |
82 | ( | 83 | ( |
83 | this.user.account.id === this.comment.account.id || | 84 | this.user.account.id === this.comment.account.id || |
84 | this.user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) | 85 | this.user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT) |
@@ -86,8 +87,8 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
86 | } | 87 | } |
87 | 88 | ||
88 | private async init () { | 89 | private async init () { |
89 | this.sanitizedCommentHTML = await this.markdownService.textMarkdownToHTML(this.comment.text, true) | 90 | const safeHTML = await this.htmlRenderer.toSafeHtml(this.comment.text) |
90 | 91 | this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(safeHTML) | |
91 | this.newParentComments = this.parentComments.concat([ this.comment ]) | 92 | this.newParentComments = this.parentComments.concat([ this.comment ]) |
92 | } | 93 | } |
93 | } | 94 | } |
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 12b74a846..d9c88e972 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -358,7 +358,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
358 | } | 358 | } |
359 | 359 | ||
360 | private async setVideoDescriptionHTML () { | 360 | private async setVideoDescriptionHTML () { |
361 | this.videoHTMLDescription = await this.markdownService.textMarkdownToHTML(this.video.description) | 361 | const html = await this.markdownService.textMarkdownToHTML(this.video.description) |
362 | this.videoHTMLDescription = await this.markdownService.processVideoTimestamps(html) | ||
362 | } | 363 | } |
363 | 364 | ||
364 | private setVideoLikesBarTooltipText () { | 365 | private setVideoLikesBarTooltipText () { |