Skip to content

Commit

Permalink
Fix problem where style attribute wasn't properly assembled in elemen…
Browse files Browse the repository at this point in the history
…t stringification
  • Loading branch information
Munter committed May 2, 2015
1 parent fd37b16 commit bf1f49b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ function stringifyStartTag(element) {
str += ' ' + key;
} else if (key === 'class') {
str += ' class="' + attrs[key].join(' ') + '"';
} else if (key === 'style') {
str += ' class="' + Object.keys(attrs[key]).map(function (cssProp) {
return [cssProp, attrs[key][cssProp]].join(': ');
}).join('; ') + '"';
} else {
str += ' ' + key + '="' + attrs[key].replace(/&/g, '&').replace(/"/g, '"') + '"';
}
Expand Down

0 comments on commit bf1f49b

Please sign in to comment.