Código PHP:
$search = array('/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s');
$replace = array('>','<','\\1');
return preg_replace($search, $replace, $buffer);
Muchas gracias, eskerrik asko.
http://www.cristalab.com/tips/compri...n-php-c67070l/