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>`;
|
).toLocaleDateString()}</a><div class="clear-both"></div>`;
|
||||||
const card = document.createElement("div");
|
const card = document.createElement("div");
|
||||||
card.className = "reply-card";
|
card.className = "reply-card";
|
||||||
|
if (typeof Sanitizer !== "undefined") {
|
||||||
const sanitizer = new Sanitizer();
|
const sanitizer = new Sanitizer();
|
||||||
card.setHTML(reply.content.html, { sanitizer });
|
card.setHTML(reply.content.html, { sanitizer });
|
||||||
|
} else {
|
||||||
|
// todo sanitize manually
|
||||||
|
card.innerHTML = reply.content.html;
|
||||||
|
}
|
||||||
card.insertBefore(author, card.firstChild);
|
card.insertBefore(author, card.firstChild);
|
||||||
cell.appendChild(card);
|
cell.appendChild(card);
|
||||||
repliesTable.append(row);
|
repliesTable.append(row);
|
||||||
|
|
Loading…
Reference in a new issue