How to use mjml-text - 2 common examples

To help you get started, we’ve selected a few mjml-text examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github homerjam / mjml-mailchimp / src / mc-text.js View on Github external
import MjText from 'mjml-text'
import { registerDependencies } from 'mjml-validator'

registerDependencies({
  'mj-column': ['mc-text'],
  'mj-hero': ['mc-text'],
  'mc-text': [],
});

export default class McText extends MjText {
  static allowedAttributes = {
    ...MjText.allowedAttributes,
    'mc:edit': 'string',
    'mc:hideable': 'string',
  }

  static defaultAttributes = {
    ...MjText.defaultAttributes,
    'mc:hideable': false
  }

  isHideable() {
    if (this.getAttribute('mc:hideable') !== false) {
      return true
    }

    return false
  }
github homerjam / mjml-mailchimp / src / mc-text.js View on Github external
registerDependencies({
  'mj-column': ['mc-text'],
  'mj-hero': ['mc-text'],
  'mc-text': [],
});

export default class McText extends MjText {
  static allowedAttributes = {
    ...MjText.allowedAttributes,
    'mc:edit': 'string',
    'mc:hideable': 'string',
  }

  static defaultAttributes = {
    ...MjText.defaultAttributes,
    'mc:hideable': false
  }

  isHideable() {
    if (this.getAttribute('mc:hideable') !== false) {
      return true
    }

    return false
  }

  renderContent(compound = false) {
    let attrs = {
      'style': 'text',
      'mc:edit': this.getAttribute('mc:edit'),
    }

mjml-text

mjml-text

MIT
Latest version published 3 months ago

Package Health Score

89 / 100
Full package analysis

Similar packages