voku / HtmlMin

:clamp: HtmlMin: HTML Compressor and Minifier via PHP
MIT License
161 stars 22 forks source link

Whitespaces before <strong> tag are removed, giving incorrect rendering #32

Closed roadster31 closed 5 years ago

roadster31 commented 5 years ago

What is this feature about (expected vs actual behaviour)?

Whitespaces before <strong> tags are removed, giving incorrect rendering :

image

How can I reproduce it?

Try to minify the following code :

<!DOCTYPE html>
<html lang="fr">
<head><title>Test</title></head>
<body>
<p>Visitez notre boutique <strong>eBay</strong> : <a href="https://stores.ebay.fr/CAFE-RACER-OLD-SPARES" target="_blank">https://stores.ebay.fr/CAFE-RACER-OLD-SPARES</a></p>
<p><strong>ID Vintage</strong>, spécialiste de la vente de pièces et accessoires pour motos tout- terrain classiques :<a href="https://id-vintage.com" target="_blank">https://id-vintage.com</a></p>
<p>Magazine <strong>Café-Racer</strong> : <a href="https://www.cafe-racer.fr" target="_blank">https://www.cafe-racer.fr</a></p>
<p><strong>Julien Lecointe</strong> : <a href="https://julien-lecointe.blogspot.com" target="_blank">https://julien-lecointe.blogspot.com</a></p>
</body>
</html>

Does it take minutes, hours or days to fix?

Not sure

Any additional information?

Using version 3.1.30 installed with composer on PHP 7.1

Thanks !

voku commented 5 years ago

Hi, I can't reproduce the issue ... I added a test for PHP 7.0 / 7.1 / 7.2 and is work on all versions. Maybe it's a Windows problem? Do you use Windows or Linux?

roadster31 commented 5 years ago

Hi, I can reproduce the problem on Windows 7 and Debian 8.11

voku commented 5 years ago

can use please run this commands in your project, thanks

composer check-platform-reqs

ext-dom 20031129 success
ext-json 1.5.0 success
ext-libxml 7.1.25 success
ext-mbstring 7.1.25 success
ext-Phar 2.0.2 success
ext-SimpleXML 7.1.25 success
ext-tokenizer 7.1.25 success
ext-xml 7.1.25 success
ext-xmlwriter 7.1.25 success
php 7.1.25 success

php -i

... dom

DOM/XML => enabled DOM/XML API Version => 20031129 libxml Version => 2.9.4 HTML Support => enabled XPath Support => enabled XPointer Support => enabled Schema Support => enabled RelaxNG Support => enabled

...

voku commented 5 years ago

Please feel free to re-open the issue if this is still a problem for you.

PS: If you can add a test-case as phpunit test that would be really helpful, thanks.