const html = this.linkifier.linkify(text)
return sanitizeHtml(html, {
- allowedTags: [ 'a', 'p', 'span', 'br' ],
+ allowedTags: [ 'a', 'p', 'span', 'br', 'strong', 'em', 'ul', 'ol', 'li' ],
allowedSchemes: [ 'http', 'https' ],
allowedAttributes: {
'a': [ 'href', 'class', 'target' ]
import { AuthService } from '../../../core/auth'
import { Video } from '../../../shared/video/video.model'
import { VideoComment } from './video-comment.model'
-import { HtmlRendererService } from '@app/shared/renderer'
+import { MarkdownService } from '@app/shared/renderer'
@Component({
selector: 'my-video-comment',
newParentComments: VideoComment[] = []
constructor (
- private htmlRenderer: HtmlRendererService,
+ private markdownService: MarkdownService,
private authService: AuthService
) {}
}
private async init () {
- this.sanitizedCommentHTML = await this.htmlRenderer.toSafeHtml(this.comment.text)
+ this.sanitizedCommentHTML = await this.markdownService.textMarkdownToHTML(this.comment.text, true)
this.newParentComments = this.parentComments.concat([ this.comment ])
}