Look carefully, very carefully, at your password-related code compared to Wikipedia code. In fact, I would recommend making the difference between the two.
metatable._index = function(t, key) local ret = rawget(t, key) if ret then return ret end ret = metatable[key] if type(ret) == 'function' then return function(...) return ret(t, ...) end else return ret end end
metatable.__index = function(t, key) local ret = rawget(t, key) if ret then return ret end ret = metatable[key] if type(ret) == 'function' then return function(...) return ret(t, ...) end else return ret end end
Do you see the difference? Meta methods in Lua always start with two underscores __ , not one. I'm not sure how your code got into the state it is in, but it will very well explain all the problems you had, even why attr not available. This was due to the __index __index , in which there is no underscore, which, of course, means that it will not be recognized at all. I am surprised that I noticed, as it is easy to skip this extra underline when skimming.
I would recommend first restoring your HtmlBuilder module to its original state, and then see if this fixes the problem. You might want to restore NavBox and any others that you may have changed if your changes are not too significant, but diff will definitely tell you what differs from your versions.
Just remember that you will change in the future, but do not be afraid to experiment while you have backups!
Ryan stein
source share