Socket
Socket
Sign inDemoInstall

mjml-text

Package Overview
Dependencies
Maintainers
1
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-text - npm Package Compare versions

Comparing version 3.1.1 to 3.2.0-beta.1

25

lib/index.js

@@ -39,2 +39,4 @@ 'use strict';

'line-height': '22px',
'letter-spacing': null,
'height': null,
'padding-bottom': null,

@@ -56,2 +58,15 @@ 'padding-left': null,

var postRender = function postRender($) {
$('.mj-text-height').each(function () {
var height = parseInt($(this).css('height'));
$(_mjmlCore.helpers.startConditionalTag + '\n <table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td height="' + height + '" style="vertical-align:top;height:' + height + 'px;">\n ' + _mjmlCore.helpers.endConditionalTag).insertBefore($(this));
$(_mjmlCore.helpers.startConditionalTag + '\n </td></tr></table>\n ' + _mjmlCore.helpers.endConditionalTag).insertAfter($(this));
$(this).removeClass('mj-text-height').filter('[class=""]').removeAttr('class');
});
return $;
};
var Text = (0, _mjmlCore.MJMLElement)(_class = function (_Component) {

@@ -90,2 +105,4 @@ _inherits(Text, _Component);

lineHeight: mjAttribute('line-height'),
letterSpacing: defaultUnit(mjAttribute('letter-spacing'), "px"),
height: defaultUnit(mjAttribute('height'), "px"),
textAlign: mjAttribute('align'),

@@ -100,6 +117,11 @@ textDecoration: mjAttribute('text-decoration'),

value: function render() {
var mjContent = this.props.mjContent;
var _props2 = this.props,
mjAttribute = _props2.mjAttribute,
mjContent = _props2.mjContent;
var classNames = mjAttribute('height') ? 'mj-text-height' : '';
return _react2.default.createElement('div', {
className: classNames,
dangerouslySetInnerHTML: { __html: mjContent() },

@@ -118,3 +140,4 @@ style: this.styles.div });

Text.baseStyles = baseStyles;
Text.postRender = postRender;
exports.default = Text;

4

package.json
{
"name": "mjml-text",
"description": "mjml-text",
"version": "3.1.1",
"version": "3.2.0-beta.1",
"main": "lib/index.js",

@@ -17,5 +17,5 @@ "repository": {

"lodash": "^4.17.2",
"mjml-core": "~3.1.1",
"mjml-core": "~3.2.0-beta.1",
"react": "^15.4.1"
}
}

@@ -41,2 +41,4 @@ ## mjml-text

line-height | px | space between the lines | 22px
letter-spacing | px | letter spacing | none
height | px | The height of the element | n/a
text-decoration | string | underline/overline/line-through/none | n/a

@@ -43,0 +45,0 @@ text-transform | string | uppercase/lowercase/capitalize | n/a

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