This commit is contained in:
squidfunk
2019-12-18 20:58:31 +01:00
parent 367211f477
commit 60330fd18d
8 changed files with 95 additions and 21 deletions

View File

@@ -52,9 +52,9 @@ type Child = Child[] | Element | Text | string | number
*/
function appendChild(el: Element, child: Child): void {
/* Handle primitive types */
/* Handle primitive types (including raw HTML) */
if (typeof child === "string" || typeof child === "number") {
el.appendChild(new Text(child.toString()))
el.innerHTML += child.toString()
/* Handle nodes */
} else if (child instanceof Node) {