aboutsummaryrefslogtreecommitdiffstats
path: root/src/theming/lua-lib/html.lua
diff options
context:
space:
mode:
authoralyx <alyx@aleteoryx.me>2024-04-05 17:27:46 -0400
committeralyx <alyx@aleteoryx.me>2024-04-05 17:27:46 -0400
commit79999cecedd84e99655fbcdba0bd4e715a22173f (patch)
tree0a14c94c92d196c1bf73f2648c2ebacfe6a03500 /src/theming/lua-lib/html.lua
parentca7c46e535ac60a976a8c60477fa9424c46b6e3f (diff)
downloadlfm_embed-79999cecedd84e99655fbcdba0bd4e715a22173f.tar.gz
lfm_embed-79999cecedd84e99655fbcdba0bd4e715a22173f.tar.bz2
lfm_embed-79999cecedd84e99655fbcdba0bd4e715a22173f.zip
Lua support feature-complete
Full implementation of debug mode still pending
Diffstat (limited to 'src/theming/lua-lib/html.lua')
-rw-r--r--src/theming/lua-lib/html.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/theming/lua-lib/html.lua b/src/theming/lua-lib/html.lua
index 386618b..6786f96 100644
--- a/src/theming/lua-lib/html.lua
+++ b/src/theming/lua-lib/html.lua
@@ -16,8 +16,8 @@ local function html(el, tbl)
expect(1, el, "string")
expect(2, tbl, "table")
- innerHtml = ""
- attributes = ""
+ local innerHtml = ""
+ local attributes = ""
for k, v in pairs(tbl) do
if type(k) == "string" then
@@ -39,6 +39,12 @@ local function root(tbl)
end
return setmetatable(
- { root = root },
+ {},
{ __call = html,
- __index = function (idx) return function(tbl) html(idx, tbl) end end })
+ __index = function (_, idx)
+ if idx == "root" then
+ return root
+ else
+ return function(tbl) return html(idx, tbl) end
+ end
+ end })