diff --git a/lib/index.js b/lib/index.js index 8fbf236b..2f04630e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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, '"') + '"'; }