mirror of
https://github.com/TangentFoxy/lua-htmlparser.git
synced 2025-07-27 18:42:19 +00:00
"settext" node method implementation. Fixes #38
This commit is contained in:
@@ -117,14 +117,18 @@ function ElementNode:gettext()
|
||||
return string.sub(self.root._text, self._openstart, self._closeend)
|
||||
end
|
||||
|
||||
function ElementNode:getcontent()
|
||||
return string.sub(self.root._text, self._openend + 1, self._closestart - 1)
|
||||
function ElementNode:settext(c)
|
||||
self.root._text=c
|
||||
end
|
||||
|
||||
function ElementNode:textonly()
|
||||
return (self:gettext():gsub("<[^>]*>",""))
|
||||
end
|
||||
|
||||
function ElementNode:getcontent()
|
||||
return string.sub(self.root._text, self._openend + 1, self._closestart - 1)
|
||||
end
|
||||
|
||||
function ElementNode:addattribute(k, v)
|
||||
self.attributes[k] = v
|
||||
if string.lower(k) == "id" then
|
||||
|
Reference in New Issue
Block a user