diff options
| author | Marin Ivanov <[email protected]> | 2024-08-20 15:24:28 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2024-08-20 15:24:28 +0300 |
| commit | 0c24aba5dd6b7804ba63d596e3ae692fccb68e88 (patch) | |
| tree | 89f39b64d3c713f833ce7a0f17bfd4d1716f1aba /ka.js | |
| parent | ec34163617e3588a63dc611834a372746f9d4107 (diff) | |
add errors
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); } |
