Mjml: Proposal: do not validate href attribute

Created on 6 Mar 2018  路  17Comments  路  Source: mjmlio/mjml

Hello,

We are using mjml output as a template which should be populated with specific details for each recipient. Our template engine uses very common <%= %> notation to denote variables that should be populated later on. Also we want to use strict validation mode to know if something went wrong and our system produced invalid mjml but it seems to not be possible in v4.
Update: actually using <%= %> in the href attribute will cause a failure in any validation level, not only in strict

Reproduction Steps:

  1. Validate mjml containing

Expected behavior:

MJML should be valid

Observed behavior:

{"message":"URI malformed"} error is given

MJML version:

v 4.0

Bug MJML 4

Most helpful comment

Hi @lessless

Thanks for reporting, It looks like a runtime error rather than a validation issue. We'll see what we can do about this

All 17 comments

Hi @lessless

Thanks for reporting, It looks like a runtime error rather than a validation issue. We'll see what we can do about this

Had the exact same issue here. This is a limitation when trying to generate any dynamic link in the template.

I also had the same issue, also when trying to generate a dynamic link in the template.

Hello.
Do you know when this issue will be solve ?

Temporary workaround is to swap <%/%> to {{/}} and back

We're working on a fix for the parser, but it can leads to lot of issues.

So let's hope we can push the fix in 4.1 release. We might need to push an "experimental" tag to let people try before ship it to the release branch.

So no ETA about it yet

Thanks for your quick responses. I'm ok if you need, to test the 4.1 release on my template before push in the release branch

Hello @iRyusa , do you have any news about the fix ?
Thanks

Hello, do you have any update about this issue ?

you are on 4.0 on 4.0.3 ?

I try with
mjml-core: 4.0.1
mjml-cli: 4.0.3

There is the code generate the URIError : URI malformed
href="?referer=sitemobile&utm_source=<%= delivery.internalName.toLowerCase() %>"

Hi @batman774 , we changed the way we handle attributes so as to allow anything in attribute values. This will fix this issue.
This change will be included in the 4.1.0 version, which should be released within one or two weeks

Hi @kmcb777 , thanks for your quick response. I'm waiting :)

Hello @kmcb777
Any news about the 4.1.0 release ?

Asking again and again doesn't help... we're doing our best, already providing releases at a quick pace: https://github.com/mjmlio/mjml/releases.

We just released a new version yesterday and have others in the pipe, you can check the milestones to see what's up: https://github.com/mjmlio/mjml/milestones.

No ETA.

Sorry for asking again. I'm sure you're doing your best
I'll follow the progression of the release on your milestones link

Beta is now available on NPM with yarn add mjml@next or npm install mjml@next please clean up your installation before installing some beta because some package aren't updated properly sometime with npm.

@batman774 @lessless feel free to test it and provide feedback about the fix. We need to check if we don't break anything on parser because it's really a critic point of MJML. So we'll release it when we're confident enough about the behavior

Was this page helpful?
0 / 5 - 0 ratings