Author Topic: Incorrect parse of CDATA when rendering HTML email  (Read 2316 times)

ewxrjk

  • Newbie
  • *
  • Posts: 1
Incorrect parse of CDATA when rendering HTML email
« on: December 25, 2018, 09:18:09 pm »
Initially analysed here: github.com/ewxrjk/rsbackup/issues/52

  • In HTML, the <style> element content is used to convey CSS stylesheets.
  • The content model is CDATA.
  • CDATA is terminated by "</", e.g. the start of the </style> tag.
  • It seems that AquaMail also interprets "/>" as terminating CDATA content.

The result is that if a stylesheet contains "/>", for instance in a comment, AquaMail misrenders it.

Nigelmay

  • Newbie
  • *
  • Posts: 34
Re: Incorrect parse of CDATA when rendering HTML email
« Reply #1 on: December 26, 2018, 01:20:38 pm »
I have the same issue, but only from a couple of correspondents, so I assume it's something to do with the way their HTML mails are constructed. It's clearly an AM issue, the same mails render perfectly in K-9.

Kostya Vasilyev

  • Hero Member
  • *****
  • Posts: 12740
Re: Incorrect parse of CDATA when rendering HTML email
« Reply #2 on: January 08, 2019, 12:49:33 pm »
There are cases of malformed messages where we have to close out a style when there is a "nested" opening tag:

<style>
.....
....
<div>
text starts here - the style tag is assumed closed at this point
</div>
</html>

Happens when people copy / paste html snippets into their newsletters (and not paying attention) or even with automated template / snippet generators.

As you can see, in these cases the <style> may not even close out ever. And without this special case, we were getting "help help, message text does not show in your app".

---

I'm willing to try and adjust our code for your nested comments case (we already handle those, but there is room for improvement it seems).

Please send a sample .eml to support / at / aqua-mail / dot com.
Creating debug logs for diagnostics: https://www.aqua-mail.com/troubleshooting/

The official FAQ: https://www.aqua-mail.com/faq/

Лог-файлы для диагностики: https://www.aqua-mail.com/ru/troubleshooting/

Вопросы и ответы: https://www.aqua-mail.com/ru/faq/