mjml-head-attributes
Advanced tools
Comparing version 2.0.5-beta.2 to 2.0.5-beta.3
@@ -25,18 +25,21 @@ 'use strict'; | ||
exports.default = function ($, _ref) { | ||
var defaultAttributes = _ref.defaultAttributes; | ||
var cssClasses = _ref.cssClasses; | ||
exports.default = { | ||
name: "mj-attributes", | ||
handler: function handler($, _ref) { | ||
var defaultAttributes = _ref.defaultAttributes; | ||
var cssClasses = _ref.cssClasses; | ||
(0, _each2.default)((0, _compact2.default)((0, _filter2.default)($.children, function (child) { | ||
return child.tagName; | ||
})), function (elem) { | ||
var tagName = elem.tagName.toLowerCase(); | ||
var attributes = elem.attribs; | ||
(0, _each2.default)((0, _compact2.default)((0, _filter2.default)($.children, function (child) { | ||
return child.tagName; | ||
})), function (elem) { | ||
var tagName = elem.tagName.toLowerCase(); | ||
var attributes = elem.attribs; | ||
if (tagName === 'mj-class') { | ||
return cssClasses[attributes.name] = (0, _omit2.default)(attributes, ['name']); | ||
} | ||
if (tagName === 'mj-class') { | ||
return cssClasses[attributes.name] = (0, _omit2.default)(attributes, ['name']); | ||
} | ||
defaultAttributes[tagName] = attributes; | ||
}); | ||
defaultAttributes[tagName] = attributes; | ||
}); | ||
} | ||
}; |
{ | ||
"name": "mjml-head-attributes", | ||
"description": "mjml-head-attributes", | ||
"version": "2.0.5-beta.2", | ||
"version": "2.0.5-beta.3", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "repository": { |
@@ -35,3 +35,7 @@ ## mjml-head-attributes | ||
<aside class="notice"> | ||
You can use mj-all to set default attributes for every components inside your MJML document | ||
</aside> | ||
<aside class="notice"> | ||
Note that the apply order of attributes is: inline attributes, then classes, then default mj-attributes and then defaultMJMLDefinition | ||
</aside> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2605
29
41