Restore line feed for markdown lists support in comments

pull/3250/head
kimsible 2020-11-06 22:37:01 +01:00 committed by Rigel Kent
parent f34cc2a48e
commit 110d463fec
2 changed files with 4 additions and 2 deletions

View 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 ])

View 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) {