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

mj-image breaks when href attribute contains "==" #1092

Closed
jsbsantos opened this issue Mar 27, 2018 · 3 comments
Closed

mj-image breaks when href attribute contains "==" #1092

jsbsantos opened this issue Mar 27, 2018 · 3 comments
Milestone

Comments

@jsbsantos
Copy link

I was using the API and noticed a strange behavior regarding the mj-image element where sometimes I would get an empty src attribute. I did some tests and eventually went to test it out on your live test page.

So I used your example there and changed it a bit:

  <mj-body>
    <mj-container>
      <mj-section>
        <mj-column>
          <mj-image  
                href="http://www.google.com"
                src="http://www.online-image-editor.com//styles/2014/images/example_image.png"
                alt="image is busted"
          ></mj-image>
        </mj-column>
      </mj-section>
    </mj-container>
  </mj-body>
</mjml>

This gave the expected result and i got the image with a link. However, when I changed the href attribute to "http://www.google.com?q=aW1hZ2UgaXMgYnVzdGVkIQ==" I get an empty src attribute.

  <mj-body>
    <mj-container>
      <mj-section>
        <mj-column>
          <mj-image  
                href="http://www.google.com/search?q=aW1hZ2UgaXMgYnVzdGVkIQ=="
                src="http://www.online-image-editor.com//styles/2014/images/example_image.png"
                alt="image is busted"
          ></mj-image>
        </mj-column>
      </mj-section>
    </mj-container>
  </mj-body>
</mjml>

Exhibit 1:
image

This happened because the URL I am using has a base64 encoded query string parameter that ends in "==". When I test with the same URL, but remove the "==" instead, it works.

Exhibit 2:
image

I'm not really sure what's happening here but I would appreciate your input.

Thanks.

@iRyusa
Copy link
Member

iRyusa commented Mar 27, 2018

Hi @jsbsantos

Thanks for reporting this ! I see that it's the same behavior on MJML4, can you take a look @kmcb777 ?

@kmcb777
Copy link
Collaborator

kmcb777 commented Mar 27, 2018

Thanks, turns out this is related to attribute encoding, and is fixed by 5dcbfd0 which will be included in the next release :)

@kmcb777 kmcb777 added this to the 4.1.0 milestone Apr 25, 2018
@kmcb777
Copy link
Collaborator

kmcb777 commented Jun 20, 2018

Hi @jsbsantos we released a new beta for mjml 4.1, which you can install with npm install mjml@next. There has been noticeable changes to the parser, could you check if it resolves the problem you had ? (It should)

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

No branches or pull requests

3 participants