How to use the mjml-core.helpers.endConditionalTag function in mjml-core

To help you get started, we’ve selected a few mjml-core 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 mjmlio / mjml / packages / mjml-hero / src / Hero.js View on Github external
backgroundCropTop = dataCrop.split(', ')[0].split(':')[1]
      backgroundCropBottom = dataCrop.split(', ')[1].split(':')[1]

      $element
        .removeAttr('class')
        .removeAttr('data-background-height')
        .removeAttr('data-crop')
    }

    backgroundWidth = parseInt(backgroundWidth.replace('px', '')) * 0.75
    backgroundHeight = parseInt(backgroundHeight.replace('px', '')) * 0.75

    $(this)
      .before(`${helpers.startConditionalTag}
          
        ${helpers.endConditionalTag}`)
      .removeAttr('class')
      .removeAttr('data-background-width')
      .removeAttr('data-background-height')
      .removeAttr('data-background-url')
  })
github mjmlio / mjml / packages / mjml-section / src / index.js View on Github external
$('.mj-section-outlook-open').each(function () {
    const $columnDiv = $(this).next()
    const classes = $columnDiv.attr('data-class') ? $columnDiv.attr('data-class')
                                                              .split(' ')
                                                              .map(c => `${c}-outlook`)
                                                              .join(' ') : false

    $(this).replaceWith(`${helpers.startConditionalTag}
      <table cellspacing="0" cellpadding="0" border="0" role="presentation">
        <tbody><tr>
          <td class="${classes}" style="vertical-align:${$columnDiv.data('vertical-align')};width:${parseInt($(this).data('width'))}px;">
      ${helpers.endConditionalTag}`)

    $columnDiv.removeAttr('data-vertical-align')
    $columnDiv.removeAttr('data-class')
  })
</td></tr></tbody></table>
github mjmlio / mjml / packages / mjml-container / src / index.js View on Github external
$('.mj-container-outlook-close').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      
      ${helpers.endConditionalTag}`)
  })
github mjmlio / mjml / packages / mjml-wrapper / src / index.js View on Github external
$('.mj-wrapper-outlook-open').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      <table cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="width:${parseInt($(this).data('width'))}px;">
      ${helpers.endConditionalTag}`)
  })
</td></tr></tbody></table>
github mjmlio / mjml / packages / mjml-hero / src / HeroContent.js View on Github external
$mjHeroContent.each(function () {
    const width = $(this).css('width')
    const align = $(this).data('align')
    const backgroundColor = $(this).data('background-color')

    $(this).before(`${helpers.startConditionalTag}
      <table style="width:${width};" width="${width.replace('px', '')}" align="${align}" cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="padding:0;background-color:${backgroundColor};">
      ${helpers.endConditionalTag}`)
    .after(`${helpers.startConditionalTag}
      </td></tr></tbody></table>
      ${helpers.endConditionalTag}`)
    .removeAttr('data-background-color')
    .removeAttr('data-align')
  })
github mjmlio / mjml / packages / mjml-social / src / index.js View on Github external
$('.mj-social-outlook-line').each(function () {
    $(this).replaceWith(`${helpers.startConditionalTag}
      
      ${helpers.endConditionalTag}`)
  })