fix: post preview body shows html tags in legacy discussion (#30007)
fix: post preview body shows HTML tags in legacy discussion
This commit is contained in:
@@ -359,7 +359,11 @@
|
||||
},
|
||||
thread.toJSON()
|
||||
);
|
||||
return $(this.threadListItemTemplate(context).toString());
|
||||
let $threadHTML = $(this.threadListItemTemplate(context).toString());
|
||||
let 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) {
|
||||
|
||||
Reference in New Issue
Block a user