File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
lib/jblond/Diff/Renderer/Html Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -208,7 +208,6 @@ public function generateLinesReplace(array $changes): string
208208 $ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
209209 $ toLine = " " ;
210210 $ changedLine = " " ;
211-
212211 if (isset ($ changes ['changed ' ]['lines ' ][$ lineNo ])) {
213212 $ toLine = $ changes ['changed ' ]['offset ' ] + $ lineNo + 1 ;
214213 $ changedLine = $ changes ['changed ' ]['lines ' ][$ lineNo ];
@@ -230,6 +229,34 @@ public function generateLinesReplace(array $changes): string
230229</tr>
231230HTML ;
232231 }
232+
233+ return $ html ;
234+ }
235+
236+ foreach ($ changes ['changed ' ]['lines ' ] as $ lineNo => $ changedLine ) {
237+ $ toLine = $ changes ['changed ' ]['offset ' ] + $ lineNo + 1 ;
238+ $ fromLine = " " ;
239+ $ line = " " ;
240+ if (isset ($ changes ['base ' ]['lines ' ][$ lineNo ])) {
241+ $ fromLine = $ changes ['base ' ]['offset ' ] + $ lineNo + 1 ;
242+ $ line = $ changes ['base ' ]['lines ' ][$ lineNo ];
243+ }
244+
245+ $ line = str_replace (["\0" , "\1" ], $ this ->options ['deleteMarkers ' ], $ line );
246+ $ changedLine = str_replace (["\0" , "\1" ], $ this ->options ['insertMarkers ' ], $ changedLine );
247+
248+ $ html .= <<<HTML
249+ <tr>
250+ <th> $ fromLine</th>
251+ <td class="Left">
252+ <span> $ line</span>
253+ </td>
254+ <th> $ toLine</th>
255+ <td class="Right">
256+ <span> $ changedLine</span>
257+ </td>
258+ </tr>
259+ HTML ;
233260 }
234261
235262 return $ html ;
You can’t perform that action at this time.
0 commit comments