Skip to content

Commit 533a6bf

Browse files
committed
Fix title attribute values
* Some values of title attributes had hardcoded references to one of the compared versions of text. They now refer to these versions using the titles as set in the renderers options. * Values can contain character sequences that break the HTML output of the renderer. The characters are now converted to HTML entities.
1 parent fb32453 commit 533a6bf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: lib/jblond/Diff/Renderer/Html/Merged.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function generateLinesDelete(array $changes): string
186186
{
187187
$this->lineOffset -= count($changes['base']['lines']);
188188

189-
$title = "Lines deleted at {$this->options['title2']}:\n";
189+
$title = "Lines of {$this->options['title1']} deleted at {$this->options['title2']}:\n";
190190

191191
foreach ($changes['base']['lines'] as $lineNo => $line) {
192192
$fromLine = $changes['base']['offset'] + $lineNo + 1;
@@ -197,7 +197,7 @@ public function generateLinesDelete(array $changes): string
197197
TEXT;
198198
}
199199

200-
$this->lastDeleted = $title;
200+
$this->lastDeleted = htmlentities($title);
201201

202202
return '';
203203
}

0 commit comments

Comments
 (0)