From 3e07114d470a70becee01879a399c64f7ac9e93e Mon Sep 17 00:00:00 2001
From: absidue <48293849+absidue@users.noreply.github.com>
Date: Tue, 16 Aug 2022 14:11:29 +0200
Subject: [PATCH] Add support for bold, italics and strikethrough formatting in
comments (#2475)
---
.../components/watch-video-comments/watch-video-comments.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/renderer/components/watch-video-comments/watch-video-comments.js b/src/renderer/components/watch-video-comments/watch-video-comments.js
index 02228c79..29cc2b1e 100644
--- a/src/renderer/components/watch-video-comments/watch-video-comments.js
+++ b/src/renderer/components/watch-video-comments/watch-video-comments.js
@@ -268,7 +268,8 @@ export default Vue.extend({
if (this.hideCommentLikes) {
comment.likes = null
}
- comment.text = autolinker.link(comment.text.replace(/(<(?!br>)([^>]+)>)/ig, ''))
+ // strip html tags but keep
, , , , ,
+ comment.text = autolinker.link(comment.text.replace(/(<(?!br|\/?(?:b|s|i)>)([^>]+)>)/ig, ''))
if (comment.customEmojis.length > 0) {
comment.customEmojis.forEach(emoji => {
comment.text = comment.text.replace(emoji.text, ``)