FelixSchwarz / mjml-python

Python implementation for MJML - a framework that makes responsive-email easy
MIT License
76 stars 16 forks source link

Fixed match.group error #2

Closed buttle closed 3 years ago

buttle commented 3 years ago

When parsing this template https://github.com/mjmlio/email-templates/blob/master/templates/welcome-email.mjml

the helper borderParser function throws the error

AttributeError: 'NoneType' object has no attribute 'group'

modified:   shorthand_parser.py
FelixSchwarz commented 3 years ago

Good catch, thank you. I'll try to add a failing test case before I merge this.

FelixSchwarz commented 3 years ago

I noticed that the welcome-email.mjml still does not work after this fix. Seems like there are additional issues to fix.

Also the upstream JS code complains about some illegal attributes (though this might be due to outdated JS code on my side) which ~probably should be~ were reported upstream (pull request about port to mjml 4).

Line 2 of welcome-email.mjml (mj-body) — Attribute font-size is illegal
Line 8 of welcome-email.mjml (mj-section) — Attribute vertical-align is illegal
Line 10 of welcome-email.mjml (mj-text) — Attribute padding-top has invalid value: 50 for type Unit, only accepts (px, %) units and 1 value(s)
Line 13 of welcome-email.mjml (mj-section) — Attribute padding-top has invalid value: 20 for type Unit, only accepts (px, %) units and 1 value(s)
buttle commented 3 years ago

I really like this project. It's exactly what I was looking for. Thank you very much.

FelixSchwarz commented 3 years ago

I really like this project. It's exactly what I was looking for. Thank you very much.

Thank you for your kind words. Please let me know if you need additional functionality :-)