From 66c03644e0dd8056ffc247ca62854e10a5446273 Mon Sep 17 00:00:00 2001 From: "Vadim A. Misbakh-Soloviov" Date: Thu, 3 Sep 2015 22:07:47 +0600 Subject: [PATCH] kludge for cases of closing void tags Signed-off-by: Vadim A. Misbakh-Soloviov --- src/htmlparser.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/htmlparser.lua b/src/htmlparser.lua index 99a2f2c..e58c6b4 100644 --- a/src/htmlparser.lua +++ b/src/htmlparser.lua @@ -53,7 +53,7 @@ local function parse(text) local closestart, closing, closename closestart, closeend, closing, closename = string.find(root._text, "[^<]*<(/?)(%w+)", closeend) 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) tag:close(closestart, closeend + 1) node = tag.parent