Skip to content

Commit

Permalink
Using htmlEscape
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Harband committed Feb 12, 2013
1 parent e9177b7 commit 98f68c3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/widgets.js
@@ -1,4 +1,5 @@
/*jslint node: true */
var htmlEscape = require('./htmlEscape');

// generates a string for common widget attributes
var attrs = function (a, needsID) {
Expand All @@ -20,7 +21,7 @@ var attrs = function (a, needsID) {
value = null;
}
if (typeof value !== 'undefined' && value !== null) {
pairs.push(field + '="' + value + '"');
pairs.push(htmlEscape(field) + '="' + htmlEscape(value) + '"');
}
});
return pairs.length > 0 ? ' ' + pairs.join(' ') : '';
Expand Down

0 comments on commit 98f68c3

Please sign in to comment.