fix webpack config

This commit is contained in:
SethBurkart123
2023-08-30 16:42:57 +10:00
parent 75026bdc51
commit 530ae91c89
11 changed files with 427 additions and 389 deletions
+12
View File
@@ -0,0 +1,12 @@
import DOMPurify from "dompurify";
export function stringToHTML(str, styles = false) {
var parser = new DOMParser();
str = DOMPurify.sanitize(str, { ADD_ATTR: ["onclick"] });
var doc = parser.parseFromString(str, "text/html");
if (styles) {
doc.body.style.cssText =
"height: auto; overflow: scroll; margin: 0px; background: var(--background-primary);";
}
return doc.body;
}