Skip to content

Commit

Permalink
Get rid of strut
Browse files Browse the repository at this point in the history
  • Loading branch information
GreLI committed Feb 23, 2015
1 parent 73f7f3c commit 84fd272
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions plugins/convertStyleToAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,8 @@ exports.fn = function(item) {
})

regDeclarationBlock.lastIndex = 0;
for (var rule, decl; rule = regDeclarationBlock.exec(styleValue);) {
decl = [rule[1], rule[2]];
decl.toString = stringifyDeclaration;
styles.push(decl);
for (var rule; rule = regDeclarationBlock.exec(styleValue);) {
styles.push([rule[1], rule[2]]);
}

if (styles.length) {
Expand Down Expand Up @@ -97,7 +95,9 @@ exports.fn = function(item) {
EXTEND(item.attrs, attrs);

if (styles.length) {
item.attr('style').value = styles.join(';');
item.attr('style').value = styles
.map(function(declaration) { return declaration.join(':') })
.join(';');
} else {
item.removeAttr('style');
}
Expand All @@ -111,7 +111,3 @@ exports.fn = function(item) {
function g() {
return '(?:' + Array.prototype.join.call(arguments, '|') + ')';
}

function stringifyDeclaration() {
return this.join(':');
}

0 comments on commit 84fd272

Please sign in to comment.