Skip to content

Commit

Permalink
Fix tagAndOrClass regex for IE7; wasn't capturing classes-with-dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
benvinegar committed Apr 5, 2011
1 parent 7b18f95 commit dd50d61
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/qwery.js
Expand Up @@ -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\-\.#]+)?)/,
Expand Down
1 change: 1 addition & 0 deletions tests/index.html
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions tests/tests.js
Expand Up @@ -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) {
Expand Down

1 comment on commit dd50d61

@benvinegar
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Please sign in to comment.