Skip to content
Browse files

Merge pull request #27 from caulagi/optional-attrs

Typo; changes to make tests work
  • Loading branch information...
2 parents b2066d3 + aeee7d3 commit e117c0eb582be6d0c7aecc44d0d68d6c56692eb3 @ljharb ljharb committed
Showing with 8 additions and 2 deletions.
  1. +7 −1 lib/widgets.js
  2. +1 −1 test/test-widgets.js
View
8 lib/widgets.js
@@ -28,12 +28,18 @@ var input = function (type) {
html += f.value ? ' value="' + f.value + '"' : '';
html += Object.keys(opt).reduce(function (html, k) {
if (ignoreAttrs.indexOf(k) === -1 && legalAttrs.indexOf(k) !== -1 || dataRegExp.test(k) || ariaRegExp.test(k)) {
- return html + ' ' + k + '="' + opt[k].replace(/"/g", '"') + '"';
+ return html + ' ' + k + '="' + opt[k].replace(/"/g, '"') + '"';
}
return html;
}, '');
return html + ' />';
};
+ w.getDataRegExp = function() {
+ return dataRegExp;
+ };
+ w.getAriaRegExp = function() {
+ return ariaRegExp;
+ };
return w;
};
};
View
2 test/test-widgets.js
@@ -257,7 +257,7 @@ exports['optional text input'] = function(test){
};
exports['optional data attribute regex test'] = function(test){
- var re = forms.widgets.text().dataRegExp;
+ var re = forms.widgets.text().getDataRegExp();
test.equals(re.test('data-'), false);
test.equals(re.test('data-input'), true);
test.equals(re.test('idata-input'), false);

0 comments on commit e117c0e

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