diff options
Diffstat (limited to 'ka.js')
| -rw-r--r-- | ka.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } |
