Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions example/a.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<body>
<h1>This is demo content to show features of the php-diff package.</h1>
<h2>This line is removed from version2.</h2>
<h2>This line is also removed from version2.</h2>
<h2>This line is the same for both versions.</h2>
<h2>This line has inline differences between both versions.</h2>
<h2>This line is the same for both versions.</h2>
Expand Down
Binary file modified htmlInline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified htmlSideBySide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified htmlUnified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/jblond/Diff/Renderer/Html/SideBySide.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public function generateTableRowsDelete(array $changes): string
foreach ($changes['base']['lines'] as $lineNo => $line) {
$fromLine = $changes['base']['offset'] + $lineNo + 1;

$html = <<<HTML
$html .= <<<HTML
<tr>
<th>$fromLine</th>
<td class="Left">
Expand Down
Binary file modified textContext.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified textUnified.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.