mjmlio / mjml

MJML: the only framework that makes responsive-email easy
https://mjml.io
MIT License
17.08k stars 960 forks source link

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

Closed jmbarbier closed 6 years ago

jmbarbier commented 6 years ago

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

iRyusa commented 6 years ago

Hi @jmbarbier Yep, you're right, align on this one doesn't use old html attribute align but text-align so we should update the enum for this one

pawl-bb commented 6 years ago

I'm seeing a similar error on mj-table's table-layout after upgrading from 4.0.3 to 4.1.1.

Attribute table-layout has invalid value: fixed for type Enum, only accepts auto/fixed/initial/inherit

I'm using it like:

<mj-table table-layout="fixed">
iRyusa commented 6 years ago

🤔 @kmcb777 can you take a look ?

kmcb777 commented 6 years ago

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

kmcb777 commented 6 years ago

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

AJ-Whalley commented 6 years ago

Hi @kmcb777 - I'm using version "^4.2.0-beta.3" and I still get the same error - "Attribute align has invalid value: justify for type Enum, only accepts left, right, center"