Open degoya opened 8 years ago
Having the same issue as well.. I have <div>Cheese <span>Pizza</span></div>
, but it's turning it into <div>Cheese<span>Pizza</span></div>
I'm seeing the same with <em>
and <a>
elements inside <p>
Good find @paullferguson! I haven't revisited this, but will definitely make a note!
@paullferguson since line 88 is the only line actually doing something, we can comment out lines 74-92.
Same problem here. I think we should make a PR, also with https://github.com/searchturbine/phpwee-php-minifier/issues/18
Hi everyone,
I am late to the party but I think replacing $c->nodeValue = trim($c->nodeValue);
with $c->nodeValue = preg_replace('/\s{2,}/im', '', $c->nodeValue);
is much better way to fix this issue.
What do you guys think?
Example:
Ilove fresh bread
I<a href="#">love</a> fresh <a href="#">bread</a></p>
Expected result: I love fresh bread
I <a href="#">love</a> fresh <a href="#">bread</a></p>