]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Restore line feed for markdown lists support in comments
authorkimsible <kimsible@users.noreply.github.com>
Fri, 6 Nov 2020 21:37:01 +0000 (22:37 +0100)
committerRigel Kent <par@rigelk.eu>
Sun, 8 Nov 2020 15:44:43 +0000 (16:44 +0100)
client/src/app/+videos/+video-watch/comment/video-comment.component.ts
client/src/app/+videos/+video-watch/comment/video-comments.component.ts

index ac2a71aa6f59d615f315c40d4546ffc1557a4e0e..3b3a5cc816f4a7213711717f762a38eb458fb392 100644 (file)
@@ -153,7 +153,9 @@ export class VideoCommentComponent implements OnInit, OnChanges {
   }
 
   private async init () {
-    const html = await this.markdownService.textMarkdownToHTML(this.comment.text, true, true)
+    // Before HTML rendering restore line feed for markdown list compatibility
+    const commentText = this.comment.text.replace(/<br.?\/?>/g, '\r\n')
+    const html = await this.markdownService.textMarkdownToHTML(commentText, true, true)
     this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(html)
     this.newParentComments = this.parentComments.concat([ this.comment ])
 
index 602bd8050bbe03f184472bc8f7390a77378e93bf..a4c651da5e73be90435156b1cec4d103fd137242 100644 (file)
@@ -199,7 +199,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
     if (confirm) {
       this.inReplyToCommentId = commentToRedraft.inReplyToCommentId
 
-      // Display <br /> tag as a break line for editing
+      // Restore line feed for editing
       const commentToRedraftText = commentToRedraft.text.replace(/<br.?\/?>/g, '\r\n')
 
       if (commentToRedraft.threadId === commentToRedraft.id) {