fix: post preview body shows html tags in legacy discussion (updated) (#30017)

fix: post preview body shows HTML tags in legacy discussion
This commit is contained in:
Abdurrahman Asad
2022-03-07 18:28:03 +05:00
committed by GitHub
parent 68e0885ca8
commit f9c9832b28

View File

@@ -359,7 +359,11 @@
},
thread.toJSON()
);
return $(this.threadListItemTemplate(context).toString());
var $threadHTML = $(this.threadListItemTemplate(context).toString());
var previewBody = $threadHTML.find('.thread-preview-body').text();
previewBody = new DOMParser().parseFromString(previewBody, "text/html").documentElement.textContent;
$threadHTML.find('.thread-preview-body').text(previewBody);
return $threadHTML;
};
DiscussionThreadListView.prototype.threadSelected = function(e) {