@@ -182,6 +182,10 @@ protected function renderTableBlockDelete(array $block): string
182
182
*/
183
183
protected function renderTableBlockReplace (array $ block ): string
184
184
{
185
+ if ($ this ->options ['detailLevel ' ] === 'none ' ) {
186
+ return $ this ->renderTableBlockDelete ($ block ) . $ this ->renderTableBlockInsert ($ block );
187
+ }
188
+
185
189
$ html = '' ;
186
190
187
191
$ oldLines = $ block ['old ' ]['lines ' ];
@@ -197,12 +201,6 @@ protected function renderTableBlockReplace(array $block): string
197
201
$ oldLinesCount = $ newLinesCount = 1 ;
198
202
}
199
203
200
- // fix for "detailLevel" is "none"
201
- if ($ this ->options ['detailLevel ' ] === 'none ' ) {
202
- $ this ->fixLinesForNoClosure ($ oldLines , RendererConstant::HTML_CLOSURES_DEL );
203
- $ this ->fixLinesForNoClosure ($ newLines , RendererConstant::HTML_CLOSURES_INS );
204
- }
205
-
206
204
// now $oldLines must has the same line counts with $newlines
207
205
for ($ no = 0 ; $ no < $ newLinesCount ; ++$ no ) {
208
206
$ mergedLine = $ this ->mergeReplaceLines ($ oldLines [$ no ], $ newLines [$ no ]);
@@ -215,9 +213,7 @@ protected function renderTableBlockReplace(array $block): string
215
213
216
214
$ html .=
217
215
'<tr data-type="!"> ' .
218
- '<td class="rep"> ' .
219
- $ mergedLine .
220
- '</td> ' .
216
+ '<td class="rep"> ' . $ mergedLine . '</td> ' .
221
217
'</tr> ' ;
222
218
}
223
219
@@ -396,23 +392,6 @@ protected function markReplaceBlockDiff(array $oldBlock, array $newBlock): array
396
392
];
397
393
}
398
394
399
- /**
400
- * Wrap the whole line with closures if it does not have one.
401
- *
402
- * @param string[] $lines the lines
403
- * @param string[] $closures the closures
404
- */
405
- protected function fixLinesForNoClosure (array &$ lines , array $ closures ): void
406
- {
407
- foreach ($ lines as &$ line ) {
408
- // there is no closure in a "replace"-type line
409
- // this means that the entire line changes
410
- if (false === \strpos ($ line , $ closures [0 ])) {
411
- $ line = "{$ closures [0 ]}{$ line }{$ closures [1 ]}" ;
412
- }
413
- }
414
- }
415
-
416
395
/**
417
396
* Determine whether the "replace"-type lines are merge-able or not.
418
397
*
0 commit comments