diff options
author | kimsible <kimsible@users.noreply.github.com> | 2020-11-06 22:37:01 +0100 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-11-08 16:44:43 +0100 |
commit | 110d463fece85e87a26aca48a6048ae0017a27b3 (patch) | |
tree | 1d1b982a557d3ef52f065b4de12f9bc6969731e1 | |
parent | f34cc2a48e534c96598490e1d13e426f05b63d0f (diff) | |
download | PeerTube-110d463fece85e87a26aca48a6048ae0017a27b3.tar.gz PeerTube-110d463fece85e87a26aca48a6048ae0017a27b3.tar.zst PeerTube-110d463fece85e87a26aca48a6048ae0017a27b3.zip |
Restore line feed for markdown lists support in comments
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comment.component.ts | 4 | ||||
-rw-r--r-- | client/src/app/+videos/+video-watch/comment/video-comments.component.ts | 2 |
2 files changed, 4 insertions, 2 deletions
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.ts index ac2a71aa6..3b3a5cc81 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 | |||
@@ -153,7 +153,9 @@ export class VideoCommentComponent implements OnInit, OnChanges { | |||
153 | } | 153 | } |
154 | 154 | ||
155 | private async init () { | 155 | private async init () { |
156 | const html = await this.markdownService.textMarkdownToHTML(this.comment.text, true, true) | 156 | // Before HTML rendering restore line feed for markdown list compatibility |
157 | const commentText = this.comment.text.replace(/<br.?\/?>/g, '\r\n') | ||
158 | const html = await this.markdownService.textMarkdownToHTML(commentText, true, true) | ||
157 | this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(html) | 159 | this.sanitizedCommentHTML = await this.markdownService.processVideoTimestamps(html) |
158 | this.newParentComments = this.parentComments.concat([ this.comment ]) | 160 | this.newParentComments = this.parentComments.concat([ this.comment ]) |
159 | 161 | ||
diff --git a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts index 602bd8050..a4c651da5 100644 --- a/client/src/app/+videos/+video-watch/comment/video-comments.component.ts +++ b/client/src/app/+videos/+video-watch/comment/video-comments.component.ts | |||
@@ -199,7 +199,7 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy { | |||
199 | if (confirm) { | 199 | if (confirm) { |
200 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId | 200 | this.inReplyToCommentId = commentToRedraft.inReplyToCommentId |
201 | 201 | ||
202 | // Display <br /> tag as a break line for editing | 202 | // Restore line feed for editing |
203 | const commentToRedraftText = commentToRedraft.text.replace(/<br.?\/?>/g, '\r\n') | 203 | const commentToRedraftText = commentToRedraft.text.replace(/<br.?\/?>/g, '\r\n') |
204 | 204 | ||
205 | if (commentToRedraft.threadId === commentToRedraft.id) { | 205 | if (commentToRedraft.threadId === commentToRedraft.id) { |