From: Max Semenik Date: Tue, 10 Dec 2013 23:58:51 +0000 (+0400) Subject: Allow customizing classes inside of diffs X-Git-Tag: 1.31.0-rc.0~17673^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=44962de1a56c40fc0d404d367c2c970fbb5b353c;p=lhc%2Fweb%2Fwiklou.git Allow customizing classes inside of diffs Not every implementation might want them Change-Id: Id186b71760d59be7e61458bf1f62965a0f2f826c --- diff --git a/includes/diff/DairikiDiff.php b/includes/diff/DairikiDiff.php index f80a4ad0f3..c47ecedb79 100644 --- a/includes/diff/DairikiDiff.php +++ b/includes/diff/DairikiDiff.php @@ -836,6 +836,9 @@ class MappedDiff extends Diff { * @ingroup DifferenceEngine */ class HWLDFWordAccumulator { + public $insClass = ' class="diffchange diffchange-inline"'; + public $delClass = ' class="diffchange diffchange-inline"'; + private $lines = array(); private $line = ''; private $group = ''; @@ -847,10 +850,10 @@ class HWLDFWordAccumulator { private function flushGroup( $new_tag ) { if ( $this->group !== '' ) { if ( $this->tag == 'ins' ) { - $this->line .= '' . + $this->line .= "insClass}>" . htmlspecialchars( $this->group ) . ''; } elseif ( $this->tag == 'del' ) { - $this->line .= '' . + $this->line .= "delClass}>" . htmlspecialchars( $this->group ) . ''; } else { $this->line .= htmlspecialchars( $this->group );