ezyang / htmlpurifier

Standards compliant HTML filter written in PHP
http://htmlpurifier.org
GNU Lesser General Public License v2.1
3.07k stars 327 forks source link

Zero trimmed from "font-size" attribute #238

Open lubomirbartos opened 4 years ago

lubomirbartos commented 4 years ago

When I send HTML containing <span style="font-size:0.5em"> some text </span> to the HTML Purifier, it trims the 0 and returns <span style="font-size:.5em">. The html without the zero then does not work well with our other technologies. Is this trimming a wanted behaviour? Would it be possible to skip trimming of the zeros?

lubomirbartos commented 4 years ago

This is where it is trimmed ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/CSS/Number.php:72.

ezyang commented 4 years ago

Avoiding the trimming sounds fine. Can you submit a PR to fix it?