mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
convert string children to text nodes
This commit is contained in:
parent
618c4ffe20
commit
77eeacb09b
@ -12,6 +12,9 @@ export function el(elementName, attrs, children) {
|
|||||||
if (Array.isArray(children)) {
|
if (Array.isArray(children)) {
|
||||||
// TODO: use fragment here?
|
// TODO: use fragment here?
|
||||||
for (let c of children) {
|
for (let c of children) {
|
||||||
|
if (typeof c === "string") {
|
||||||
|
c = text(c);
|
||||||
|
}
|
||||||
e.appendChild(c);
|
e.appendChild(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user