diff --git a/lib/jblond/Diff/Renderer/Html/SideBySide.php b/lib/jblond/Diff/Renderer/Html/SideBySide.php index 57c27be7..992d029b 100644 --- a/lib/jblond/Diff/Renderer/Html/SideBySide.php +++ b/lib/jblond/Diff/Renderer/Html/SideBySide.php @@ -208,7 +208,6 @@ public function generateLinesReplace(array $changes): string $fromLine = $changes['base']['offset'] + $lineNo + 1; $toLine = " "; $changedLine = " "; - if (isset($changes['changed']['lines'][$lineNo])) { $toLine = $changes['changed']['offset'] + $lineNo + 1; $changedLine = $changes['changed']['lines'][$lineNo]; @@ -230,6 +229,34 @@ public function generateLinesReplace(array $changes): string HTML; } + + return $html; + } + + foreach ($changes['changed']['lines'] as $lineNo => $changedLine) { + $toLine = $changes['changed']['offset'] + $lineNo + 1; + $fromLine = " "; + $line = " "; + if (isset($changes['base']['lines'][$lineNo])) { + $fromLine = $changes['base']['offset'] + $lineNo + 1; + $line = $changes['base']['lines'][$lineNo]; + } + + $line = str_replace(["\0", "\1"], $this->options['deleteMarkers'], $line); + $changedLine = str_replace(["\0", "\1"], $this->options['insertMarkers'], $changedLine); + + $html .= << +