Skip to content

Commit

Permalink
Fix title attribute values
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
DigiLive authored and DigiLive committed Mar 27, 2021
1 parent fb32453 commit 533a6bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jblond/Diff/Renderer/Html/Merged.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public function generateLinesDelete(array $changes): string
{
$this->lineOffset -= count($changes['base']['lines']);

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

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

$this->lastDeleted = $title;
$this->lastDeleted = htmlentities($title);

return '';
}
Expand Down

0 comments on commit 533a6bf

Please sign in to comment.