Go to the documentation of this file.
36 $this->leadingContextLines = 2;
37 $this->trailingContextLines = 2;
46 $msg = preg_replace(
'/^ /m',
"\u{00A0} ", $msg );
47 $msg = preg_replace(
'/ $/m',
" \u{00A0}", $msg );
48 $msg = preg_replace(
'/ /',
"\u{00A0} ", $msg );
61 protected function blockHeader( $xbeg, $xlen, $ybeg, $ylen ) {
64 $r =
'<tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l' .
69 '<td colspan="2" class="diff-lineno"><!--LINE ' .
93 protected function lines(
$lines, $prefix =
' ', $color =
'white' ) {
137 if (
$line !==
'' ) {
142 return "<td class='diff-marker'>$marker</td><td class='$class'>$line</td>";
149 return "<td colspan=\"2\">\u{00A0}</td>";
160 $this->
addedLine(
'<ins class="diffchange">' .
161 htmlspecialchars(
$line ) .
'</ins>' ) .
"</tr>\n" );
173 htmlspecialchars(
$line ) .
'</del>' ) .
197 protected function changed( $orig, $closing ) {
199 $del = $diff->orig();
200 $add = $diff->closing();
202 # Notice that WordLevelDiff returns HTML-escaped output.
203 # Hence, we will be calling addedLine/deletedLine without HTML-escaping.
205 $ndel = count( $del );
206 $nadd = count( $add );
207 $n = max( $ndel, $nadd );
208 for ( $i = 0; $i < $n; $i++ ) {
211 $this->
writeOutput(
"<tr>{$delLine}{$addLine}</tr>\n" );
Performs a word-level diff on several lines.
static tags( $element, $attribs, $contents)
Same as Xml::element(), but does not escape contents.