File tree 1 file changed +25
-4
lines changed
lib/jblond/Diff/Renderer/Html
1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -208,15 +208,11 @@ public function generateLinesReplace(array $changes): string
208
208
$ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
209
209
$ toLine = " " ;
210
210
$ changedLine = " " ;
211
-
212
211
if (isset ($ changes ['changed ' ]['lines ' ][$ lineNo ])) {
213
212
$ toLine = $ changes ['changed ' ]['offset ' ] + $ lineNo + 1 ;
214
213
$ changedLine = $ changes ['changed ' ]['lines ' ][$ lineNo ];
215
214
}
216
215
217
- $ line = str_replace (["\0" , "\1" ], $ this ->options ['deleteMarkers ' ], $ line );
218
- $ changedLine = str_replace (["\0" , "\1" ], $ this ->options ['insertMarkers ' ], $ changedLine );
219
-
220
216
$ html .= <<<HTML
221
217
<tr>
222
218
<th> $ fromLine</th>
@@ -230,6 +226,31 @@ public function generateLinesReplace(array $changes): string
230
226
</tr>
231
227
HTML ;
232
228
}
229
+
230
+ return $ html ;
231
+ }
232
+
233
+ foreach ($ changes ['changed ' ]['lines ' ] as $ lineNo => $ changedLine ) {
234
+ $ toLine = $ changes ['changed ' ]['offset ' ] + $ lineNo + 1 ;
235
+ $ fromLine = " " ;
236
+ $ line = " " ;
237
+ if (isset ($ changes ['base ' ]['lines ' ][$ lineNo ])) {
238
+ $ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
239
+ $ line = $ changes ['base ' ]['lines ' ][$ lineNo ];
240
+ }
241
+
242
+ $ html .= <<<HTML
243
+ <tr>
244
+ <th> $ fromLine</th>
245
+ <td class="Left">
246
+ <span> $ line</span>
247
+ </td>
248
+ <th> $ toLine</th>
249
+ <td class="Right">
250
+ <span> $ changedLine</span>
251
+ </td>
252
+ </tr>
253
+ HTML ;
233
254
}
234
255
235
256
return $ html ;
You can’t perform that action at this time.
0 commit comments