Blog, news, announcement and more! removes full style attribute on unexpected contents

email client tricks

We’ve had reports that our latest versafix-1 template (1.1.16) shows its mobile version on Yandex webmail even on desktop.

After some investigation we found that Yandex is stripping whole style attributes when the style contains something unexpected.

We did some search to find existing informations about Yandex issues, but found nothing relevant, so we decided to dig into it and document the behaviour.

What we found webmail usually removes a properties if it doesn’t know it or doesn’t understand the property value, but it sometimes remove the whole style! We found that the full style attribute removal happens in a couple of cases:

  • When there are round brackets in a property value and you have some symbols in the content, like ‘_’, ‘-‘, ‘+’, ‘*’, ‘&’
  • On every property value if a sequence “- “ is found or a “NUMBER-“ or “-NUMBER” is found.

An example

Let’s see an example code:

<div style="color: red; -unknown-prop: value">A</div>
<div style="color: red; -unknown-prop: value - 2">B</div>
<div style="color: red; -unknown-prop: -5something">C</div>
<div style="color: red; -unknown-prop: something(in brackets)">D</div>
<div style="color: red; -unknown-prop: something(in - brackets)">E</div>

is cleaned up by Yandex to this:

<div style="color:red;">A</div>
<div style="color:red;">D</div>

Yandex is removing also the properties he understands like “color: red” when the style contains something he doesn’t like.

No Fab4, then?

So, this issue makes the Fab4 technique ineffective without additional hacks.

We documented the bug in the versafix-1 repository. We’ll try some additional hack to see if we can get the desktop version on Yandex even if partially using the Fab4 approach.

Unfortunately we’re not aware of known hacks to target webmail so to put some specific workaround in place, so we’ll need a generic solution and something that doesn’t break any other email client.

Did you experience this bug? How did you fix it? Do you have more details about the issue? Get in touch with us!

... do you want to help improve this content? ... View revision history Edit