Fixes new lines not being displayed in comments (#1719)

This commit is contained in:
Jason 2021-09-20 09:25:50 +00:00 committed by GitHub
parent 94756458b1
commit c14aeab8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -50,6 +50,7 @@
} }
.commentText { .commentText {
white-space: pre-wrap;
font-size: 14px; font-size: 14px;
margin-top: -10px; margin-top: -10px;
margin-left: 70px; margin-left: 70px;

View File

@ -264,7 +264,7 @@ export default Vue.extend({
if (this.hideCommentLikes) { if (this.hideCommentLikes) {
comment.likes = null comment.likes = null
} }
comment.text = autolinker.link(comment.text.replace(/(<([^>]+)>)/ig, '')) comment.text = autolinker.link(comment.text.replace(/(<(?!br>)([^>]+)>)/ig, ''))
return comment return comment
}) })
@ -296,7 +296,7 @@ export default Vue.extend({
} else { } else {
comment.likes = comment.likeCount comment.likes = comment.likeCount
} }
comment.text = autolinker.link(comment.content.replace(/(<([^>]+)>)/ig, '')) comment.text = autolinker.link(comment.content.replace(/(<(?!br>)([^>]+)>)/ig, ''))
comment.dataType = 'invidious' comment.dataType = 'invidious'
if (typeof (comment.replies) !== 'undefined' && typeof (comment.replies.replyCount) !== 'undefined') { if (typeof (comment.replies) !== 'undefined' && typeof (comment.replies.replyCount) !== 'undefined') {
@ -362,7 +362,7 @@ export default Vue.extend({
} else { } else {
comment.likes = comment.likeCount comment.likes = comment.likeCount
} }
comment.text = autolinker.link(comment.content.replace(/(<([^>]+)>)/ig, '')) comment.text = autolinker.link(comment.content.replace(/(<(?!br>)([^>]+)>)/ig, ''))
comment.time = comment.publishedText comment.time = comment.publishedText
comment.dataType = 'invidious' comment.dataType = 'invidious'
comment.numReplies = 0 comment.numReplies = 0