ActivityPub-federated video streaming platform using P2P directly in your web browser
Support basic markdown in comments
Chocobozzz1aa7543403f2
diff --git a/client/src/app/shared/renderer/html-renderer.service.ts b/client/src/app/shared/renderer/html-renderer.service.tsindex 28ef51e727..94a8aa4c65 100644--- a/client/src/app/shared/renderer/html-renderer.service.ts+++ b/client/src/app/shared/renderer/html-renderer.service.ts@@ -16,7 +16,7 @@ export class HtmlRendererService {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' ]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.tsindex 4d3c049a19..23ff20aad8 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/vimport { 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',@@ -28,7 +28,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {newParentComments: VideoComment[] = []constructor (- private htmlRenderer: HtmlRendererService,+ private markdownService: MarkdownService,private authService: AuthService) {}@@ -86,7 +86,7 @@ export class VideoCommentComponent implements OnInit, OnChanges {}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 ])}