import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'
+import { MarkdownService } from '@app/videos/shared'
import * as sanitizeHtml from 'sanitize-html'
import { Account as AccountInterface } from '../../../../../../shared/models/actors'
import { UserRight } from '../../../../../../shared/models/users'
sanitizedCommentHTML = ''
newParentComments = []
- constructor (private authService: AuthService) {}
+ constructor (
+ private authService: AuthService,
+ private markdownService: MarkdownService
+ ) {}
get user () {
return this.authService.getUser()
private init () {
this.sanitizedCommentHTML = sanitizeHtml(this.comment.text, {
- allowedTags: [ 'p', 'span', 'br' ]
+ allowedTags: [ 'a', 'p', 'span', 'br' ],
+ allowedSchemes: [ 'http', 'https' ]
})
+ // Convert possible markdown to html
+ this.sanitizedCommentHTML = this.markdownService.linkify(this.comment.text)
+
this.newParentComments = this.parentComments.concat([ this.comment ])
}
}