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:
Abdurrahman Asad
2022-03-04 17:48:17 +05:00
committed by GitHub
parent 0d9e845f1b
commit 89f92a1a9d

View File

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