Skip to content

Commit

Permalink
fix(css-selectors): extend regex to include superscript in range, fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuuGan authored and fb55 committed Feb 14, 2019
1 parent a5f1991 commit dc51092
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module.exports = parse;

var re_name = /^(?:\\.|[\w\-\u00c0-\uFFFF])+/,
var re_name = /^(?:\\.|[\w\-\u00b0-\uFFFF])+/,
re_escape = /\\([\da-f]{1,6}\s?|(\s)|.)/ig,
//modified version of https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L87
re_attr = /^\s*((?:\\.|[\w\u00c0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00c0-\uFFFF\-])*)|)|)\s*(i)?\]/;
re_attr = /^\s*((?:\\.|[\w\u00b0-\uFFFF\-])+)\s*(?:(\S?)=\s*(?:(['"])([^]*?)\3|(#?(?:\\.|[\w\u00b0-\uFFFF\-])*)|)|)\s*(i)?\]/;

var actionTypes = {
__proto__: null,
Expand Down
15 changes: 15 additions & 0 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ var tests = [
],
"Space after escaped space"
],
[
".m™²³",
[
[
{
type: "attribute",
name: "class",
action: "element",
value: "m™²³",
ignoreCase: false
}
]
],
"Special charecters in selector"
],
[
"\\61 ",
[
Expand Down

0 comments on commit dc51092

Please sign in to comment.