Skip to content

Commit

Permalink
Restore line feed for markdown lists support in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kimsible committed Nov 6, 2020
1 parent 6a9498e commit 83ad76b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 83ad76b

Please sign in to comment.