]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/comment/video-comments.component.ts
Correct break line display for re-draft comments
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / comment / video-comments.component.ts
index 79627b1af1bc82e4bb642614daf74f9813bbd5d7..602bd8050bbe03f184472bc8f7390a77378e93bf 100644 (file)
@@ -199,10 +199,13 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
     if (confirm) {
       this.inReplyToCommentId = commentToRedraft.inReplyToCommentId
 
+      // Display <br /> tag as a break line for editing
+      const commentToRedraftText = commentToRedraft.text.replace(/<br.?\/?>/g, '\r\n')
+
       if (commentToRedraft.threadId === commentToRedraft.id) {
-        this.commentThreadRedraftValue = commentToRedraft.text
+        this.commentThreadRedraftValue = commentToRedraftText
       } else {
-        this.commentReplyRedraftValue = commentToRedraft.text
+        this.commentReplyRedraftValue = commentToRedraftText
       }
 
     }