nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.81k stars 1.38k forks source link

Inline images not rendering correctly - body contains raw html #839

Closed majal closed 8 years ago

majal commented 8 years ago

Please see attached image from WP email. This had been around for quite a while... (I'm using N1 for Vivid)

screenshot from 2015-12-26 17-20-59

mbilker commented 8 years ago

Thanks for the bug report @Majal. What OS are you on? What version of N1? Do these emails render properly in other mail clients?

This looks like a parsing bug for the email since there are some HTML attributes in that image.

mbilker commented 8 years ago

I just got a similar error with a Google+ email.

2015-12-27-22-33-11_818x525 modified

Should look like (from Gmail web):

2015-12-27-22-36-25_722x272

mbilker commented 8 years ago

It have something to do with URL parsing

majal commented 8 years ago

Hi @mbilker,

OS: Description: Ubuntu Xenial Xerus (development branch) Release: 16.04 Codename: xenial

N1 Version: 0.3.32-b11131d

Rendering in other clients? Yes, correctly in all I've used: Gmail, Thunderbird, and Geary

Yup, N1 does seem to have problems in parsing HTML. We hope the devs can get this fixed soon. More (coffee) power to you!

Majal

bengotow commented 8 years ago

Hey folks—the issue here is this HTML in the message body:

<img border="0" class="" src="http://0.gravatar.com/avatar/3e8e161d97d793bd8fc2d=
cd62583bb76?s=100&amp;d=mm&amp;r=g" alt="Dominik Schilling" / style=
="max-width: 100%; height: auto; margin-bottom: 12px; clear: bot....

(Notice that / sitting right in the middle between src and style.) Unfortunately it's throwing off autolinker, which linkifies the src thinking that it's a link outside of a tag. Not sure what the best course of action is here, but we definitely need to fix it.

bashok001 commented 8 years ago

I have this same issue on all Google+ emails. Rendering is broken there.

bengotow commented 8 years ago

Hey folks—I believe we've finally tracked this down. This appears to be the cause:

https://github.com/gregjacobs/Autolinker.js/issues/146

mbilker commented 8 years ago

Thank you tracking this down @bengotow !

bengotow commented 8 years ago

This should be fixed now that we're using our own DOM-aware link highlighting instead of autolinker. Stay tuned! 465831175aa00e3e8a08de6d2791d9e37f516c54

bengotow commented 8 years ago

Hey! This shipped in 0.4.19 a few minutes ago. You can grab the update by choosing "Check for Updates" from N1's application menu, or download the new version directly from the releases section of the project. Enjoy!