diff options
author | Norbert Preining <norbert@preining.info> | 2021-09-15 03:01:59 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-09-15 03:01:59 +0000 |
commit | 3c36091e77e72aa582c29594048a092b63eae83c (patch) | |
tree | d26c30b3c7aed52f2ce9df0fc80a94899d6d34e3 /macros/luatex/generic/luaxml/luaxml-parse-query.lua | |
parent | 1666f2f182d9f9fb45ef8aa275b477d3264ef1cb (diff) |
CTAN sync 202109150301
Diffstat (limited to 'macros/luatex/generic/luaxml/luaxml-parse-query.lua')
-rw-r--r-- | macros/luatex/generic/luaxml/luaxml-parse-query.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/macros/luatex/generic/luaxml/luaxml-parse-query.lua b/macros/luatex/generic/luaxml/luaxml-parse-query.lua index 17ddeb82c5..9ed2aa9385 100644 --- a/macros/luatex/generic/luaxml/luaxml-parse-query.lua +++ b/macros/luatex/generic/luaxml/luaxml-parse-query.lua @@ -18,10 +18,11 @@ local white = S(" \t\n") ^ 0 -- luaxml doesn't support XML namespaces and elements must be queried using -- dom:query_selector("namespace|element") local word = (alphanum + S("_-") + S("|")) ^ 1 +local attr_word = (alphanum + S("_-") + S("|:")) ^ 1 local combinators = S(">~+") -local attr_name = (alphanum + S("_-")) ^ 1 +local attr_name = (alphanum + S("_-:")) ^ 1 local attr_function = S("~|^$*") ^ 0 local attr_content = C((P(1) - quotes) ^ 1) @@ -45,7 +46,7 @@ parse_query = function(query) local first_of_type = P(":first-of-type") / mark("first-of-type") local last = P(":last-child") / mark("last-child") local last_of_type = P(":last-of-type") / mark("last-of-type") - local attr = P("[") * C(word) * P("]") / mark("attr") + local attr = P("[") * C(attr_word) * P("]") / mark("attr") local attr_value = P("[") * C(attr_name ) * C(attr_function)* P("=") * quotes * attr_content * quotes * P("]") / mark("attr_value") local combinator = C(combinators) / mark("combinator") local selector = Ct((any + nth + first + first_of_type + last + last_of_type + tag + cls + id + attr + attr_value + combinator) ^ 1) |