Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated mj-tag's inside mj-attributes get ignored #1194

Closed
rinopo opened this issue May 14, 2018 · 3 comments
Closed

Repeated mj-tag's inside mj-attributes get ignored #1194

rinopo opened this issue May 14, 2018 · 3 comments
Milestone

Comments

@rinopo
Copy link

rinopo commented May 14, 2018

Hi,

Repeated mj-tags inside the mj-attributes seem to be ignored except for the last ones.

Reproduction Steps:

Use following MJML sources:

https://mjml.io/try-it-live/HkEN2o8Az

<mjml>
  <mj-head>
    <mj-attributes>
      <mj-all color="blue" />
      <mj-all font-size="40px" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>
          Hello World!
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

or

<mjml>
  <mj-head>
    <mj-attributes>
      <mj-text color="blue" />
      <mj-text font-size="40px" />
    </mj-attributes>
  </mj-head>
  <mj-body>
    <mj-section>
      <mj-column>
        <mj-text>
          Hello World!
        </mj-text>
      </mj-column>
    </mj-section>
  </mj-body>
</mjml>

Expected behavior:

Both color and font-size attributes are applied to Hello World!.

Observed behavior:

Only the last attribute (here font-size) is applied to Hello World!.

MJML version:

The "try-it-live" version (4.0.5?).

@rinopo
Copy link
Author

rinopo commented May 14, 2018

You could work around this like:

    <mj-attributes>
      <mj-text color="blue" font-size="40px" />
    </mj-attributes>

But I thought I'd file it as an issue since:

  • Repeated mj-tags inside mj-attributes used to work back in MJML3.
  • It is not clearly documented (allowed or not allowed).
  • I prefer using repeated mj-tags because I find it more readable, especially when you want to specify more than a couple of attributes.

Thank you so much for your consideration.

@iRyusa
Copy link
Member

iRyusa commented May 14, 2018

Thanks for finding this @rinopo

We'll try to fix it for 4.1 release. cc @kmcb777

@kmcb777 kmcb777 added this to the 4.1.0 milestone May 15, 2018
@kmcb777
Copy link
Collaborator

kmcb777 commented Jun 20, 2018

Hi @rinopo we released a new beta for mjml 4.1, which you can install with npm install mjml@next, could you check if it resolves the problem you had ?

@iRyusa iRyusa closed this as completed in 1d7c05e Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants