diff --git a/README.md b/README.md index 7ed8adb9..67be32fa 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,15 @@ echo $diff->Render($renderer); ### Example Output A quick usage example can be found in the `example/` directory and under example.php. +#### HTML Side By Side Example ![HTML Side By Side Example](htmlSideBySide.png "HTML Side By Side Example") +#### HTML Inline Example ![HTML Inline Example](htmlInline.png "HTML Inline Example") +#### HTML Unified Example ![HTML Unified Example](htmlUnified.png "HTML Unified Example") +#### Text Unified Example ![Text Unified Example](textUnified.png "Text Unified Example") +#### Text Context Example ![Text Context Example](textContext.png "Text Context Example") ## Requirements diff --git a/example/a.txt b/example/a.txt index cdf834c1..eab1ced5 100644 --- a/example/a.txt +++ b/example/a.txt @@ -6,6 +6,7 @@

This is demo content to show features of the php-diff package.

This line is removed from version2.

+

This line is also removed from version2.

This line is the same for both versions.

This line has inline differences between both versions.

This line is the same for both versions.

diff --git a/htmlInline.png b/htmlInline.png index 23dac18c..ab141c32 100644 Binary files a/htmlInline.png and b/htmlInline.png differ diff --git a/htmlSideBySide.png b/htmlSideBySide.png index 328f5a36..a292908a 100644 Binary files a/htmlSideBySide.png and b/htmlSideBySide.png differ diff --git a/htmlUnified.png b/htmlUnified.png index e653f474..bc63c8cd 100644 Binary files a/htmlUnified.png and b/htmlUnified.png differ diff --git a/lib/jblond/Diff/Renderer/Html/SideBySide.php b/lib/jblond/Diff/Renderer/Html/SideBySide.php index c70e40c5..0efc8ea5 100644 --- a/lib/jblond/Diff/Renderer/Html/SideBySide.php +++ b/lib/jblond/Diff/Renderer/Html/SideBySide.php @@ -141,7 +141,7 @@ public function generateTableRowsDelete(array $changes): string foreach ($changes['base']['lines'] as $lineNo => $line) { $fromLine = $changes['base']['offset'] + $lineNo + 1; - $html = << $fromLine diff --git a/textContext.png b/textContext.png index e90fbbb4..c9c93f20 100644 Binary files a/textContext.png and b/textContext.png differ diff --git a/textUnified.png b/textUnified.png index 04c83d9a..7379e81a 100644 Binary files a/textUnified.png and b/textUnified.png differ