mirror of
https://github.com/msva/lua-htmlparser.git
synced 2024-11-27 12:44:22 +00:00
Fix for "name" handling in match(); Fixes #37
This commit is contained in:
parent
bc23cd4f78
commit
a64b0aaf5f
@ -155,7 +155,7 @@ local function select(self, s)
|
|||||||
start, pos, switch, type, name, eq, quote = string.find(part,
|
start, pos, switch, type, name, eq, quote = string.find(part,
|
||||||
"(%(?%)?)" .. -- switch = a possible ( or ) switching the filter on or off
|
"(%(?%)?)" .. -- switch = a possible ( or ) switching the filter on or off
|
||||||
"([:%[#.]?)" .. -- type = a possible :, [, #, or .
|
"([:%[#.]?)" .. -- type = a possible :, [, #, or .
|
||||||
"(%w+)" .. -- name = 1 or more alfanumeric chars
|
"([%w-_\\]+)" .. -- name = 1 or more alfanumeric chars (+ hyphen, reverse slash and uderscore)
|
||||||
"([|%*~%$!%^]?=?)" .. -- eq = a possible |=, *=, ~=, $=, !=, ^=, or =
|
"([|%*~%$!%^]?=?)" .. -- eq = a possible |=, *=, ~=, $=, !=, ^=, or =
|
||||||
"(['\"]?)", -- quote = a ' or " delimiting a possible attribute value
|
"(['\"]?)", -- quote = a ' or " delimiting a possible attribute value
|
||||||
pos + 1
|
pos + 1
|
||||||
@ -193,4 +193,4 @@ end
|
|||||||
function ElementNode:select(s) return select(self, s) end
|
function ElementNode:select(s) return select(self, s) end
|
||||||
ElementNode.mt.__call = select
|
ElementNode.mt.__call = select
|
||||||
|
|
||||||
return ElementNode
|
return ElementNode
|
||||||
|
Loading…
Reference in New Issue
Block a user