Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why do the CSS & HTML minifiers add so many line breaks?

BREAKS CSS html line
0
Posted

Why do the CSS & HTML minifiers add so many line breaks?

0

It’s rumored that some source control tools don’t like very long lines. Compressed files with shorter lines are also easier to diff. Since both Minify classes are regex-based, it would be very difficult/error-prone to count characters then try to re-establish context to add line breaks. Instead, both classes trade 1 space for 1 line break (\n) wherever possible, adding breaks but without adding bytes. If you can think of another safe & efficient way to limit lines in these two tools without adding bytes, submit a patch or some pseudocode to the support group.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123