Switch scripts to redesign

This commit is contained in:
Zack Rauen
2023-09-27 23:18:03 -04:00
parent a7edc5e03e
commit 4147f2b8d8
10 changed files with 204 additions and 28 deletions

View File

@@ -0,0 +1,7 @@
export default function parseHTML(html: string, fragment = false) {
const template = document.createElement("template");
template.innerHTML = html;
const node = template.content.cloneNode(true);
if (fragment) return node;
return node.childNodes.length > 1 ? node.childNodes : node.childNodes[0];
}