protected function blockHeader( $xbeg, $xlen, $ybeg, $ylen ) {
// '<!--LINE \d+ -->' get replaced by a localised line number
// in DifferenceEngine::localiseLineNumbers
- $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' . $xbeg . '" ><!--LINE ' . $xbeg . "--></td>\n" .
- '<td colspan="2" class="diff-lineno"><!--LINE ' . $ybeg . "--></td></tr>\n";
+ $r = '<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' .
+ $xbeg .
+ '" ><!--LINE ' .
+ $xbeg .
+ "--></td>\n" .
+ '<td colspan="2" class="diff-lineno"><!--LINE ' .
+ $ybeg .
+ "--></td></tr>\n";
return $r;
}
# Notice that WordLevelDiff returns HTML-escaped output.
# Hence, we will be calling addedLine/deletedLine without HTML-escaping.
- while ( $line = array_shift( $del ) ) {
+ $line = array_shift( $del );
+ while ( $line ) {
$aline = array_shift( $add );
echo '<tr>' . $this->deletedLine( $line ) .
$this->addedLine( $aline ) . "</tr>\n";
+ $line = array_shift( $del );
}
foreach ( $add as $line ) { # If any leftovers
echo '<tr>' . $this->emptyLine() .