summaryrefslogtreecommitdiff
path: root/ka.js
diff options
context:
space:
mode:
Diffstat (limited to 'ka.js')
-rw-r--r--ka.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ka.js b/ka.js
index a73bc9f..b7f9d6a 100644
--- a/ka.js
+++ b/ka.js
@@ -34,13 +34,13 @@ elproto.$change2state = function(state, field, valgetter=getvalue) {
function tag(name, attrs, ...children) {
const el = doc.createElement(name);
el.$attrs(attrs||{});
- for (const child of children) {
+ for (const child of children.filter(x=>x)) {
el.appendChild((typeof(child) === 'string') ? doc.createTextNode(child) : child);
}
return el;
}
-const TRIVIAL = "h1,h2,h3,p,a,div,span,select,table,tr,td";
+const TRIVIAL = "h1,h2,h3,p,,div,span,select,table,tr,td";
for (let name of TRIVIAL.split(",")) {
window[name] = (...children) => tag(name, null, ...children);
}