mirror of
https://github.com/TangentFoxy/lua-htmlparser.git
synced 2025-07-28 02:52:19 +00:00
Allow custom tag HTML5 tags to include hyphens.
This commit is contained in:
11
tst/init.lua
11
tst/init.lua
@@ -277,3 +277,14 @@ function test_order()
|
||||
assert_equal(i, tonumber(v.name), "notn order")
|
||||
end
|
||||
end
|
||||
|
||||
function test_tagnames_with_hyphens()
|
||||
local tree = htmlparser.parse([[
|
||||
<tag-name id="9999">
|
||||
<m id="10000"></m>
|
||||
</tag-name>
|
||||
]])
|
||||
assert_equal(1, #tree.nodes, "top level")
|
||||
assert_equal("tag-name", tree("#9999")[1].name, "#9999")
|
||||
assert_equal("m", tree("#10000")[1].name, "#10000")
|
||||
end
|
||||
|
Reference in New Issue
Block a user