css-revealer
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -13,7 +13,7 @@ 'use strict'; | ||
if (isId(selector)) { | ||
return new RegExp('id="[^"]*' + sanitise(selector)).test(string); | ||
return new RegExp('id="[^"]*\\b' + sanitise(selector) + '\\b').test(string); | ||
} | ||
if (isClass(selector)) { | ||
return new RegExp('class="[^"]*' + sanitise(selector)).test(string); | ||
return new RegExp('class="[^"]*\\b' + sanitise(selector) + '\\b').test(string); | ||
} | ||
@@ -20,0 +20,0 @@ |
{ | ||
"name": "css-revealer", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Reveal CSS selector usage within HTML templates.", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -16,1 +16,7 @@ 'use strict'; | ||
}); | ||
test('should correctly match at word boundaries', function(t){ | ||
t.plan(2); | ||
t.notOk(isSelectorInString('.myClass', readFixture('templateOne.html'))); | ||
t.notOk(isSelectorInString('.MyClass', readFixture('templateOne.html'))); | ||
}); |
Sorry, the diff of this file is not supported yet
21520
533