How to use the mjml-core/lib/helpers/conditionalTag 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-accordion / src / AccordionElement.js View on Github external
render() {
    return `
      
        
          <label>
            ${conditionalTag(
              `
              <input>
            `,
              true,
            )}
            <div>
              ${this.handleMissingChildren()}
            </div>
          </label>
github mjmlio / mjml / packages / mjml-text / src / index.js View on Github external
render() {
    const height = this.getAttribute('height')

    return height
      ? `
        ${conditionalTag(`
          <table cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="vertical-align:top;height:${height};" height="${height}">
        `)}
        ${this.renderContent()}
        ${conditionalTag(`
          </td></tr></tbody></table>
        `)}
      `
      : this.renderContent()
  }
}
github mjmlio / mjml / packages / mjml-navbar / src / NavbarLink.js View on Github external
render() {
    return `
        ${conditionalTag(`
          
        `)}
        ${this.renderContent()}
        ${conditionalTag(`
          
        `)}
      `
  }
github mjmlio / mjml / packages / mjml-spacer / src / index.js View on Github external
render() {
    const height = this.getAttribute('height')

    return `
      ${conditionalTag(`
        <table cellspacing="0" cellpadding="0" border="0" role="presentation"><tbody><tr><td style="vertical-align:top;height:${height};" height="${parseInt(
          height,
          10,
        )}">
      `)}
      <div>
        &nbsp;
      </div>
      ${conditionalTag(`
        </td></tr></tbody></table>
      `)}
    `