Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix tagAndOrClass regex for IE7; wasn't capturing classes-with-dashes

  • Loading branch information...
commit dd50d612f6c0839fbaf63791cab692d8c2a9881e 1 parent 7b18f95
@benvinegar benvinegar authored
Showing with 5 additions and 1 deletion.
  1. +1 −1  src/qwery.js
  2. +1 −0  tests/index.html
  3. +3 −0  tests/tests.js
View
2  src/qwery.js
@@ -7,7 +7,7 @@
idOnly = /^#([\w\-]+$)/,
classOnly = /^\.([\w\-]+)$/,
tagOnly = /^([\w\-]+)$/,
- tagAndOrClass = /^([\w]+)?\.([\w\-])+$/,
+ tagAndOrClass = /^(\w+)?\.([\w\-]+)$/,
html = doc.documentElement,
tokenizr = /\s(?![\s\w\-\/\?\&\=\:\.\(\)\!,@#%<>\{\}\$\*\^'"]*\])/,
simple = /^([a-z0-9]+)?(?:([\.\#]+[\w\-\.#]+)?)/,
View
1  tests/index.html
@@ -20,6 +20,7 @@
<h1>Qwery Tests</h1>
<div foo="bar"></div>
<div class="a"></div>
+ <div class="class-with-dashes"></div>
<div id="boosh">
<div class="a b">
<div class="d e" test="fg" id="booshTest"></div>
View
3  tests/tests.js
@@ -40,6 +40,9 @@ sink('CSS 1', function (test, ok) {
ok(Q('#boosh div,#boosh span').length == 3, 'found 2 divs and 1 span');
});
+ test('class with dashes', 1, function() {
+ ok(Q('.class-with-dashes').length == 1, 'found something');
+ });
});
sink('CSS 2', function (test, ok) {

1 comment on commit dd50d61

@benvinegar

Just a heads up that I didn't rebuild the distributable files in / before committing.

Please sign in to comment.
Something went wrong with that request. Please try again.