Skip to content

Commit 2eb9fd0

Browse files
authored
Merge pull request #33 from JBlond/php-diff-32
Fix Issue #32
2 parents 3e243f1 + 7ef67e6 commit 2eb9fd0

File tree

8 files changed

+7
-1
lines changed

8 files changed

+7
-1
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,15 @@ echo $diff->Render($renderer);
6464
### Example Output
6565
A quick usage example can be found in the `example/` directory and under example.php.
6666

67+
#### HTML Side By Side Example
6768
![HTML Side By Side Example](htmlSideBySide.png "HTML Side By Side Example")
69+
#### HTML Inline Example
6870
![HTML Inline Example](htmlInline.png "HTML Inline Example")
71+
#### HTML Unified Example
6972
![HTML Unified Example](htmlUnified.png "HTML Unified Example")
73+
#### Text Unified Example
7074
![Text Unified Example](textUnified.png "Text Unified Example")
75+
#### Text Context Example
7176
![Text Context Example](textContext.png "Text Context Example")
7277

7378
## Requirements

example/a.txt

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<body>
77
<h1>This is demo content to show features of the php-diff package.</h1>
88
<h2>This line is removed from version2.</h2>
9+
<h2>This line is also removed from version2.</h2>
910
<h2>This line is the same for both versions.</h2>
1011
<h2>This line has inline differences between both versions.</h2>
1112
<h2>This line is the same for both versions.</h2>

htmlInline.png

134 KB
Loading

htmlSideBySide.png

201 KB
Loading

htmlUnified.png

107 KB
Loading

lib/jblond/Diff/Renderer/Html/SideBySide.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function generateTableRowsDelete(array $changes): string
141141
foreach ($changes['base']['lines'] as $lineNo => $line) {
142142
$fromLine = $changes['base']['offset'] + $lineNo + 1;
143143

144-
$html = <<<HTML
144+
$html .= <<<HTML
145145
<tr>
146146
<th>$fromLine</th>
147147
<td class="Left">

textContext.png

121 KB
Loading

textUnified.png

85.7 KB
Loading

0 commit comments

Comments
 (0)