question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mjml-text align="justify" : Attribute align has invalid value

See original GitHub issue

Docs (from mjml.io, and the README.md from mjml-text package) says that allowed attributes for align are “left, right, center, justify”. The arguments listed in attributes checking enum from packages/mjml-text/src/index.jsare only left, right and center. So when using align="justify" the compiler raises an error/warning.

Using 4.1.0 nodejs mjml2html with no option :

[
  {
    "line": 55,
    "message": "Attribute align has invalid value: justify for type Enum, only accepts left, right, center",
    "tagName": "mj-text",
    "formattedMessage": "Line 55 of /api (mj-text) — Attribute align has invalid value: justify for type Enum, only accepts left, right, center"
  },

I couldn’t find a word on align=“justify” being deprecated, so the error should be in enum : https://github.com/mjmlio/mjml/blob/f7051e5054aa88da489a5fa5f16a81176c56b435/packages/mjml-text/src/index.js#L9

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kmcb777commented, Sep 13, 2018

Hi @pawl-bb this has been fixed in the new release mjml4.2-beta, which you can install with npm install mjml, you can check if it solves the problem

1reaction
kmcb777commented, Aug 6, 2018

hi @pawl-bb thanks for reporting this, it will be fixed in the next version

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid align attribute HTML - css - Stack Overflow
But I get this strange error: The 'align' attribute is invalid - The value 'middle' is invalid according to its datatype 'Union' -...
Read more >
Applying text-justify attribute to List Report does not have ... - IBM
Symptom. All justified text will be simply rendered as a default style. Cause. HTML browser can not recognize the text-align attribute ...
Read more >
mjml-divider: Versions - Openbase
Prevent the validator from throwing an error when mjml is provided as Json ... #1272 mjml-text Attribute align="justify" is no longer considered as...
Read more >
mjml-text - npm
attribute unit description default value color color text color #000000 font‑family string font Ubuntu, Helvetica, Arial, sans‑serif font‑size px text size 13px
Read more >
text-align: justify? - OutSystems
But text still have default align left. What am I doing wrong? 0. 0. 19 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found