60 foreach ( $this->xpath->query(
'//text()' )
as $child ) {
61 if ( strtolower( $child->parentNode->nodeName ) ===
'pre' ) {
63 if ( substr_compare( $child->data,
"\n", 0 ) === 0 ) {
64 $child->data = substr( $child->data, 1 );
66 if ( substr_compare( $child->data,
"\n", -1 ) === 0 ) {
67 $child->data = substr( $child->data, 0, -1 );
71 $child->data = trim( $child->data );
73 if ( $child->data ===
'' ) {
74 $child->parentNode->removeChild( $child );