Skip to content

Commit d197aea

Browse files
committed
Update HtmlDiff.php
1 parent e9b4836 commit d197aea

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

HtmlDiff.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -266,15 +266,15 @@ private function InsertTag( $tag, $cssClass, &$words ) {
266266
$this->content .= $specialCaseTagInjection . implode( "", $this->ExtractConsecutiveWords( $words, 'tag' ) );
267267
} else {
268268
$workTag = $this->ExtractConsecutiveWords( $words, 'tag' );
269-
if( $this->IsOpeningTag( $workTag[ 0 ] ) && !$this->IsClosingTag( $workTag[ 0 ] ) ) {
270-
if( strpos( $workTag[ 0 ], 'class=' ) ) {
271-
$workTag[ 0 ] = str_replace( 'class="', 'class="diffmod ', $workTag[ 0 ] );
272-
$workTag[ 0 ] = str_replace( "class='", 'class="diffmod ', $workTag[ 0 ] );
273-
} else {
274-
$workTag[ 0 ] = str_replace( ">", ' class="diffmod">', $workTag[ 0 ] );
275-
}
276-
}
277-
$this->content .= implode( "", $workTag ) . $specialCaseTagInjection;
269+
if( $this->IsOpeningTag( $workTag[ 0 ] ) && !$this->IsClosingTag( $workTag[ 0 ] ) ) {
270+
if( strpos( $workTag[ 0 ], 'class=' ) ) {
271+
$workTag[ 0 ] = str_replace( 'class="', 'class="diffmod ', $workTag[ 0 ] );
272+
$workTag[ 0 ] = str_replace( "class='", 'class="diffmod ', $workTag[ 0 ] );
273+
} else {
274+
$workTag[ 0 ] = str_replace( ">", ' class="diffmod">', $workTag[ 0 ] );
275+
}
276+
}
277+
$this->content .= implode( "", $workTag ) . $specialCaseTagInjection;
278278
}
279279
}
280280
}

0 commit comments

Comments
 (0)