mirror of
https://github.com/TangentFoxy/lua-htmlparser.git
synced 2025-07-28 11:02:18 +00:00
__call = select
This commit is contained in:
@@ -89,7 +89,7 @@ function ElementNode:close(closestart, closeend)
|
||||
end
|
||||
end
|
||||
|
||||
function ElementNode:select(s)
|
||||
local function select(self, s)
|
||||
if not s or type(s) ~= "string" then return {} end
|
||||
local subjects = Set:new({self})
|
||||
local resultset
|
||||
@@ -116,4 +116,7 @@ function ElementNode:select(s)
|
||||
return resultset:tolist()
|
||||
end
|
||||
|
||||
function ElementNode:select(s) return select(self, s) end
|
||||
ElementNode.mt.__call = select
|
||||
|
||||
return ElementNode
|
Reference in New Issue
Block a user