Microsoft Outlook produces some slightly unusual css when creating emails. One such example is:
margin-bottom: 0.0001pt;
Using the cssparser on such content exposes a bug in the LexicalUnitImpl class with how the float value is converted into a String. The String is in scientific notation and includes the exponent:
margin-bottom: 1.0E-4pt;
As I thought it helpful I've attached a small patch which includes a new unit test for the exponent issue and also a fix for converting the float value to a String.
Erica
Anonymous
Updated patch that will format the number correctly regarless of Locale
Thansk for the patch? Just one question
why you choose 4 here?
A somewhat arbitary number, it was enough precision for the particular Microsoft Outlook case. Although that level of precision for the margin is likely unnecessary and will probably get rounded to 0 when a webview renders the content.
Many thanks. Do you need a new release?
If it's not too much trouble that would really handy to pick up this fix
Ok will do it over the weekend after some more tests.
Last edit: RBRi 2019-03-23
The new release is out; many thanks for your contribution.