Socket
Socket
Sign inDemoInstall

mjml-core

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-core - npm Package Compare versions

Comparing version 3.3.0 to 3.3.1

2

lib/configs/defaultContainer.js

@@ -14,3 +14,3 @@ 'use strict';

exports.default = function () {
return '<!doctype html>\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">\n<head>\n <title>__title__</title>\n <!--[if !mso]><!-- -->\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <!--<![endif]-->\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n<style type="text/css">' + _defaultStyle2.default + '</style>\n<!--[if !mso]><!-->\n<style type="text/css">\n @media only screen and (max-width:480px) {\n @-ms-viewport { width:320px; }\n @viewport { width:320px; }\n }\n</style>\n<!--<![endif]-->\n<!--[if mso]>\n<xml>\n <o:OfficeDocumentSettings>\n <o:AllowPNG/>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n</xml>\n<![endif]-->\n<!--[if lte mso 11]>\n<style type="text/css">\n .outlook-group-fix {\n width:100% !important;\n }\n</style>\n<![endif]-->\n</head>\n<body>\n __content__\n</body>\n</html>';
return '<!doctype html>\n<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">\n<head>\n <title>__title__</title>\n <!--[if !mso]><!-- -->\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <!--<![endif]-->\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n<meta name="viewport" content="width=device-width, initial-scale=1.0">\n<style type="text/css">' + _defaultStyle2.default + '</style>\n<!--[if !mso]><!-->\n<style type="text/css">\n @media only screen and (max-width:480px) {\n @-ms-viewport { width:320px; }\n @viewport { width:320px; }\n }\n</style>\n<!--<![endif]-->\n<!--[if mso]>\n<xml>\n <o:OfficeDocumentSettings>\n <o:AllowPNG/>\n <o:PixelsPerInch>96</o:PixelsPerInch>\n </o:OfficeDocumentSettings>\n</xml>\n<![endif]-->\n<!--[if lte mso 11]>\n<style type="text/css">\n .outlook-group-fix {\n width:100% !important;\n }\n</style>\n<![endif]-->\n</head>\n<body>\n __content__\n</body>\n</html>';
};

@@ -86,3 +86,3 @@ 'use strict';

td: {
wordBreak: 'break-word'
wordWrap: 'break-word'
}

@@ -89,0 +89,0 @@ };

@@ -61,3 +61,3 @@ 'use strict';

var version = exports.version = function version() {
return '3.3.0';
return '3.3.1';
};

@@ -64,0 +64,0 @@ var MJMLValidator = exports.MJMLValidator = _mjmlValidator2.default;

@@ -102,2 +102,26 @@ 'use strict';

var DANGEROUS_CHARS = ['{{', '}}', '<%', '%>', '<', '>', '{%', '%}', '{{{', '}}}'];
var SEED = Math.floor(Math.random() * 0x10000000000).toString(16);
var PLACEHOLDER = '__MJML__' + SEED + '__';
var mjmlSanitizer = function mjmlSanitizer(mjml) {
if (mjml.children && mjml.children) {
(0, _each2.default)(mjml.children, mjmlSanitizer);
}
if (mjml.content) {
mjml.content = sanitizer(mjml.content);
}
};
var sanitizer = function sanitizer(text) {
return DANGEROUS_CHARS.reduce(function (content, char, index) {
return content.replace(new RegExp(char, 'g'), '' + PLACEHOLDER + index);
}, text);
};
var restore = function restore(text) {
return DANGEROUS_CHARS.reduce(function (content, char, index) {
return content.replace(new RegExp('' + PLACEHOLDER + index, 'g'), char);
}, text);
};
var getMJBody = function getMJBody(root) {

@@ -188,2 +212,4 @@ return (0, _find2.default)(root.children, ['tagName', 'mj-body']);

mjmlSanitizer(this.content);
var body = getMJBody(this.content);

@@ -240,3 +266,3 @@ var head = getMJHead(this.content);

return [!this.options.disableMjStyle ? (0, _curryRight2.default)(inlineExternal)(externalCSS) : undefined, this.options.beautify ? beautifyHTML : undefined, !this.options.disableMinify && this.options.minify ? minifyHTML : undefined, _he2.default.decode].filter(function (element) {
return [!this.options.disableMjStyle ? (0, _curryRight2.default)(inlineExternal)(externalCSS) : undefined, this.options.beautify ? beautifyHTML : undefined, !this.options.disableMinify && this.options.minify ? minifyHTML : undefined, _he2.default.decode, restore].filter(function (element) {
return typeof element == 'function';

@@ -243,0 +269,0 @@ }).reduce(function (res, fun) {

{
"name": "mjml-core",
"description": "mjml-core",
"version": "3.3.0",
"version": "3.3.1",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc