Skip to content

Commit

Permalink
Merge branch 'attributes' of https://github.com/brandonbarringer/inky
Browse files Browse the repository at this point in the history
…into attributes
  • Loading branch information
devender2 committed Jun 6, 2016
2 parents 10f7b17 + d773618 commit 2b0dd54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/componentFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ var $ = require('cheerio');
*/
module.exports = function(element) {
var inner = element.html();


function attrs() {
var attrs = element.attr();
var standardAttributes = ['class', 'id', 'href', 'size'];
var result = ''

for (var key in attrs) {
if (standardAttributes.indexOf(key) == -1) result += (' ' + key + '=' + '"' + attrs[key] + '"');
}
return result;
}



Expand Down

0 comments on commit 2b0dd54

Please sign in to comment.