ea13aa94 by Adam Heath

If the value passed to getAttrValueMatch is quoted, then remove the

quotes.
1 parent 2626a712
...@@ -98,6 +98,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => { ...@@ -98,6 +98,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
98 98
99 const getAttrValueMatch = (value: string, operator: string = '=', caseSensitive: boolean): AttrValueMatch => { 99 const getAttrValueMatch = (value: string, operator: string = '=', caseSensitive: boolean): AttrValueMatch => {
100 if (value === undefined) return (attrValue) => attrValue !== undefined 100 if (value === undefined) return (attrValue) => attrValue !== undefined
101 if (value[ 0 ] === '"' || value[ 0 ] === '\'') value = value.substring(1, value.length - 1)
101 const isCaseInsensitive = caseSensitive === 'i' 102 const isCaseInsensitive = caseSensitive === 'i'
102 if (isCaseInsensitive) value = value.toLowerCase() 103 if (isCaseInsensitive) value = value.toLowerCase()
103 const adjustMatcher = (matcher) => isCaseInsensitive ? (attrValue) => matcher(attrValue.toLowerCase()) : matcher 104 const adjustMatcher = (matcher) => isCaseInsensitive ? (attrValue) => matcher(attrValue.toLowerCase()) : matcher
......