@@ -126,27 +126,18 @@ protected function renderTableBlockEqual(array $block): string
126126 // the old and the new may not be exactly the same
127127 // because of ignoreCase, ignoreWhitespace, etc
128128 foreach ($ block ['new ' ]['lines ' ] as $ no => $ newLine ) {
129- if ($ this ->options ['lineNumbers ' ]) {
130- $ oldLine = $ block ['old ' ]['lines ' ][$ no ];
129+ $ oldLine = $ block ['old ' ]['lines ' ][$ no ];
131130
132- $ oldLineNum = $ block ['old ' ]['offset ' ] + $ no + 1 ;
133- $ newLineNum = $ block ['new ' ]['offset ' ] + $ no + 1 ;
131+ $ oldLineNum = $ block ['old ' ]['offset ' ] + $ no + 1 ;
132+ $ newLineNum = $ block ['new ' ]['offset ' ] + $ no + 1 ;
134133
135- $ html .=
136- '<tr> ' .
137- $ this ->renderLineNumberColumn ('old ' , $ oldLineNum ) .
138- '<td class="old"> ' . $ oldLine . '</td> ' .
139- $ this ->renderLineNumberColumn ('new ' , $ newLineNum ) .
140- '<td class="new"> ' . $ newLine . '</td> ' .
141- '</tr> ' ;
142- } else {
143- // hmm... but there is only space for one line
144- // we could only pick either the old or the new to show
145- $ html .=
146- '<tr> ' .
147- '<td class="new" colspan="2"> ' . $ newLine . '</td> ' .
148- '</tr> ' ;
149- }
134+ $ html .=
135+ '<tr> ' .
136+ $ this ->renderLineNumberColumn ('old ' , $ oldLineNum ) .
137+ '<td class="old"> ' . $ oldLine . '</td> ' .
138+ $ this ->renderLineNumberColumn ('new ' , $ newLineNum ) .
139+ '<td class="new"> ' . $ newLine . '</td> ' .
140+ '</tr> ' ;
150141 }
151142
152143 return $ html ;
@@ -162,22 +153,15 @@ protected function renderTableBlockInsert(array $block): string
162153 $ html = '' ;
163154
164155 foreach ($ block ['new ' ]['lines ' ] as $ no => $ newLine ) {
165- if ($ this ->options ['lineNumbers ' ]) {
166- $ newLineNum = $ block ['new ' ]['offset ' ] + $ no + 1 ;
156+ $ newLineNum = $ block ['new ' ]['offset ' ] + $ no + 1 ;
167157
168- $ html .=
169- '<tr> ' .
170- $ this ->renderLineNumberColumn ('' , null ) .
171- '<td class="old"></td> ' .
172- $ this ->renderLineNumberColumn ('new ' , $ newLineNum ) .
173- '<td class="new"> ' . $ newLine . '</td> ' .
174- '</tr> ' ;
175- } else {
176- $ html .=
177- '<tr> ' .
178- '<td class="new" colspan="2"> ' . $ newLine . '</td> ' .
179- '</tr> ' ;
180- }
158+ $ html .=
159+ '<tr> ' .
160+ $ this ->renderLineNumberColumn ('' , null ) .
161+ '<td class="old"></td> ' .
162+ $ this ->renderLineNumberColumn ('new ' , $ newLineNum ) .
163+ '<td class="new"> ' . $ newLine . '</td> ' .
164+ '</tr> ' ;
181165 }
182166
183167 return $ html ;
@@ -193,22 +177,15 @@ protected function renderTableBlockDelete(array $block): string
193177 $ html = '' ;
194178
195179 foreach ($ block ['old ' ]['lines ' ] as $ no => $ oldLine ) {
196- if ($ this ->options ['lineNumbers ' ]) {
197- $ oldLineNum = $ block ['old ' ]['offset ' ] + $ no + 1 ;
180+ $ oldLineNum = $ block ['old ' ]['offset ' ] + $ no + 1 ;
198181
199- $ html .=
200- '<tr> ' .
201- $ this ->renderLineNumberColumn ('old ' , $ oldLineNum ) .
202- '<td class="old"> ' . $ oldLine . '</td> ' .
203- $ this ->renderLineNumberColumn ('' , null ) .
204- '<td class="new"></td> ' .
205- '</tr> ' ;
206- } else {
207- $ html .=
208- '<tr> ' .
209- '<td class="old" colspan="2"> ' . $ oldLine . '</td> ' .
210- '</tr> ' ;
211- }
182+ $ html .=
183+ '<tr> ' .
184+ $ this ->renderLineNumberColumn ('old ' , $ oldLineNum ) .
185+ '<td class="old"> ' . $ oldLine . '</td> ' .
186+ $ this ->renderLineNumberColumn ('' , null ) .
187+ '<td class="new"></td> ' .
188+ '</tr> ' ;
212189 }
213190
214191 return $ html ;
0 commit comments