How to use the mjml-text.allowedAttributes function in mjml-text

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
  }

mjml-text

mjml-text

MIT
Latest version published 11 months ago

Package Health Score

85 / 100
Full package analysis

Similar packages