fix: catch if browser doesn't have Sanitizer
This commit is contained in:
parent
7cd385aa0c
commit
bb0bfd2b2f
1 changed files with 7 additions and 2 deletions
|
@ -62,8 +62,13 @@ function createRepliesBlock(replies, heading) {
|
|||
).toLocaleDateString()}</a><div class="clear-both"></div>`;
|
||||
const card = document.createElement("div");
|
||||
card.className = "reply-card";
|
||||
const sanitizer = new Sanitizer();
|
||||
card.setHTML(reply.content.html, { sanitizer });
|
||||
if (typeof Sanitizer !== "undefined") {
|
||||
const sanitizer = new Sanitizer();
|
||||
card.setHTML(reply.content.html, { sanitizer });
|
||||
} else {
|
||||
// todo sanitize manually
|
||||
card.innerHTML = reply.content.html;
|
||||
}
|
||||
card.insertBefore(author, card.firstChild);
|
||||
cell.appendChild(card);
|
||||
repliesTable.append(row);
|
||||
|
|
Loading…
Reference in a new issue