convert string children to text nodes

This commit is contained in:
Bruno Windels 2019-02-26 20:49:32 +01:00
parent 618c4ffe20
commit 77eeacb09b

View File

@ -12,6 +12,9 @@ export function el(elementName, attrs, children) {
if (Array.isArray(children)) {
// TODO: use fragment here?
for (let c of children) {
if (typeof c === "string") {
c = text(c);
}
e.appendChild(c);
}
}