diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 04:12:19 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2018-10-19 04:12:19 +0000 |
| commit | 727f04aac784382e7ecb18b817830d145355b735 (patch) | |
| tree | bede6333759084b40820dc2c4e364f69d84e48cb /lib | |
| parent | fix all pages (diff) | |
| download | mmm-727f04aac784382e7ecb18b817830d145355b735.tar.gz mmm-727f04aac784382e7ecb18b817830d145355b735.zip | |
switch to self-rendering lua code
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/html.client.moon | 5 | ||||
| -rw-r--r-- | lib/html.server.moon | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/html.client.moon b/lib/html.client.moon index 2538f8d..45794da 100644 --- a/lib/html.client.moon +++ b/lib/html.client.moon @@ -1,5 +1,3 @@ -document = js.global.document - element = (element) -> (...) -> children = { ... } @@ -12,7 +10,8 @@ element = (element) -> (...) -> with e = document\createElement element for k,v in pairs attributes - e[k] = v + if 'string' == type k + e[k] = v -- if there is only one argument, -- children can be in attributes table too diff --git a/lib/html.server.moon b/lib/html.server.moon index bbeaa9d..cc68fc7 100644 --- a/lib/html.server.moon +++ b/lib/html.server.moon @@ -10,6 +10,7 @@ element = (element) -> (...) -> b = "<#{element}" for k,v in pairs attributes + continue unless 'string' == type k if 'table' == type v tmp = '' for kk, vv in pairs v |
