From 07da484ec52ef780e0c3f45f02d30835fe5f9cfa Mon Sep 17 00:00:00 2001 From: DigiLive Date: Sat, 21 Nov 2020 18:18:17 +0100 Subject: [PATCH] Fix HTML Merged Renderer Stray tags present when lines removed from version 2. --- lib/jblond/Diff/Renderer/Html/Merged.php | 2 +- tests/resources/htmlMerged.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/jblond/Diff/Renderer/Html/Merged.php b/lib/jblond/Diff/Renderer/Html/Merged.php index b96eb63..b55889b 100644 --- a/lib/jblond/Diff/Renderer/Html/Merged.php +++ b/lib/jblond/Diff/Renderer/Html/Merged.php @@ -253,7 +253,7 @@ function ($removedParts) use ($addedParts) { */ public function generateBlockFooter(array $changes): string { - return ''; + return $changes['tag'] != 'delete' ? '' : ''; } /** diff --git a/tests/resources/htmlMerged.txt b/tests/resources/htmlMerged.txt index 37364a9..0e261b7 100644 --- a/tests/resources/htmlMerged.txt +++ b/tests/resources/htmlMerged.txt @@ -24,7 +24,7 @@ 7         <h1>This is demo content to show features of the php-diff package.</h1> - + 8