summaryrefslogtreecommitdiff
path: root/ka.js
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-08-20 15:24:28 +0300
committerMarin Ivanov <[email protected]>2024-08-20 15:24:28 +0300
commit0c24aba5dd6b7804ba63d596e3ae692fccb68e88 (patch)
tree89f39b64d3c713f833ce7a0f17bfd4d1716f1aba /ka.js
parentec34163617e3588a63dc611834a372746f9d4107 (diff)
add errors
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);
}