mirror of
https://github.com/msva/lua-htmlparser.git
synced 2024-11-04 23:34:20 +00:00
kludge for cases of closing void tags
Signed-off-by: Vadim A. Misbakh-Soloviov <git@mva.name>
This commit is contained in:
parent
0938f8424b
commit
66c03644e0
@ -53,7 +53,7 @@ local function parse(text)
|
|||||||
local closestart, closing, closename
|
local closestart, closing, closename
|
||||||
closestart, closeend, closing, closename = string.find(root._text, "[^<]*<(/?)(%w+)", closeend)
|
closestart, closeend, closing, closename = string.find(root._text, "[^<]*<(/?)(%w+)", closeend)
|
||||||
if not closing or closing == "" then break end
|
if not closing or closing == "" then break end
|
||||||
tag = table.remove(opentags[closename]) or tag -- kludge for cases of closing tag that wasn't opened
|
tag = table.remove(opentags[closename] or {}) or tag -- kludges for the cases of closing void or non-opened tags
|
||||||
closestart = string.find(root._text, "<", closestart)
|
closestart = string.find(root._text, "<", closestart)
|
||||||
tag:close(closestart, closeend + 1)
|
tag:close(closestart, closeend + 1)
|
||||||
node = tag.parent
|
node = tag.parent
|
||||||
|
Loading…
Reference in New Issue
Block a user