Skip to content

Issue with mj-html-attributes and templating language tags <% %> #2744

@cantoniriccardo

Description

@cantoniriccardo

Describe the bug
When we use mj-html-attributes and a templating language like EJS inside a compontent, a tag <%= my_variable %> is not preserved as is, but it is rendered as <%= my_variable="" %="" />.

To Reproduce
Steps to reproduce the behavior:

  1. Copy and paste the following code in the try-it-live tool:
<mjml>
  <mj-head>
    <mj-html-attributes>
      <mj-selector path=".custom div">
        <mj-html-attribute name="data-id">42</mj-html-attribute>
      </mj-selector>
    </mj-html-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text css-class="custom">
          Hello <%= world %>
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>
  1. See error

Expected behavior
We expect the tag <% ... %> to be rendered as is.

MJML environment

  • MJML Version 4.9.3
  • MJML try-it-live tool

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions