diff --git a/index.js b/index.js index 428c2239..fdb98c9d 100644 --- a/index.js +++ b/index.js @@ -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, diff --git a/tests/test.js b/tests/test.js index eae54423..8c583c64 100644 --- a/tests/test.js +++ b/tests/test.js @@ -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 ", [