mankyd / htmlmin

A configurable HTML Minifier with safety features
https://htmlmin.readthedocs.org/en/latest/
Other
129 stars 40 forks source link

Process character references in data #60

Open mina86 opened 3 years ago

mina86 commented 3 years ago

Re-escape characters in data to minimise code further. In data sections only ampersand and less-than sign need to be escaped. Since characters are always shorter than their entities not escaping what doesn’t need to saves space. Furthermore, don’t escape ampersand in situations in which HTML5 dictates it doesn’t need to be escape.

mankyd commented 3 years ago

Thanks for the PR. I am going to spend some time digesting this and hope to get it in soon if it makes sense.