Index: trunk/extensions/CodeReview/backend/DiffHighlighter.php |
— | — | @@ -86,18 +86,19 @@ |
87 | 87 | |
88 | 88 | function formatLine( $content, $class = null ) { |
89 | 89 | |
90 | | - if( is_null($class) ) { |
| 90 | + if ( $class === null ) { |
91 | 91 | return Html::rawElement( 'tr', $this->getLineIdAttr(), |
92 | | - Html::Element( 'td', array( 'class'=>'linenumbers' ), $this->left ) |
93 | | - . Html::Element( 'td', array( 'class'=>'linenumbers' ), $this->right ) |
94 | | - . Html::Element( 'td', array() , $content ) |
| 92 | + Html::element( 'td', array( 'class' => 'linenumbers' ), $this->left ) |
| 93 | + . Html::element( 'td', array( 'class' => 'linenumbers' ), $this->right ) |
| 94 | + . Html::rawElement( 'td', array() , Html::element( 'span', array() , $content ) ) |
95 | 95 | ); |
96 | 96 | } |
97 | 97 | |
98 | 98 | # Skip line number when they do not apply |
99 | 99 | $left = $right = ' '; |
| 100 | + $inlineWrapEl = 'span'; |
100 | 101 | |
101 | | - switch( $class ) { |
| 102 | + switch ( $class ) { |
102 | 103 | case 'chunkdelimiter': |
103 | 104 | $left = $right = '—'; |
104 | 105 | break; |
— | — | @@ -107,20 +108,22 @@ |
108 | 109 | break; |
109 | 110 | case 'del': |
110 | 111 | $left = $this->left; |
| 112 | + $inlineWrapEl = 'del'; |
111 | 113 | break; |
112 | 114 | case 'ins': |
113 | 115 | $right = $this->right; |
| 116 | + $inlineWrapEl = 'ins'; |
114 | 117 | break; |
115 | 118 | |
116 | 119 | default: |
117 | 120 | # Rely on $left, $right initialization above |
118 | 121 | } |
119 | 122 | |
120 | | - $classAttr = is_null($class) ? array() : array( 'class' => $class ); |
| 123 | + $classAttr = is_null( $class ) ? array() : array( 'class' => $class ); |
121 | 124 | return Html::rawElement( 'tr', $this->getLineIdAttr(), |
122 | | - Html::rawElement( 'td', array( 'class'=>'linenumbers' ), $left ) |
123 | | - . Html::rawElement( 'td', array( 'class'=>'linenumbers' ), $right ) |
124 | | - . Html::Element( 'td', $classAttr, $content ) |
| 125 | + Html::element( 'td', array( 'class' => 'linenumbers' ), $left ) |
| 126 | + . Html::element( 'td', array( 'class' => 'linenumbers' ), $right ) |
| 127 | + . Html::rawElement( 'td', $classAttr , Html::element( $inlineWrapEl, array() , $content ) ) |
125 | 128 | ); |
126 | 129 | } |
127 | 130 | |