import { AuthService } from '../../../core/auth'
import { Video } from '../../../shared/video/video.model'
import { VideoComment } from './video-comment.model'
-import { MarkdownService } from '@app/shared/renderer'
+import { HtmlRendererService, MarkdownService } from '@app/shared/renderer'
@Component({
selector: 'my-video-comment',
newParentComments: VideoComment[] = []
constructor (
+ private htmlRenderer: HtmlRendererService,
private markdownService: MarkdownService,
private authService: AuthService
) {}
}
isRemovableByUser () {
- return this.comment.account && this.isUserLoggedIn() &&
+ return this.isUserLoggedIn() &&
(
this.user.account.id === this.comment.account.id ||
this.user.hasRight(UserRight.REMOVE_ANY_VIDEO_COMMENT)
}
private async init () {
- this.sanitizedCommentHTML = await this.markdownService.textMarkdownToHTML(this.comment.text, true)
-
+ const safeHTML = await this.htmlRenderer.toSafeHtml(this.comment.text)
+ this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(safeHTML)
this.newParentComments = this.parentComments.concat([ this.comment ])
}
}