From aa88dc340d5dbb1c0dcee98fe5e7a0b7e0f15977 Mon Sep 17 00:00:00 2001 From: mchev Date: Wed, 1 Apr 2026 21:30:32 +0200 Subject: [PATCH] Closes #588 --- app/Support/PdfHtmlSanitizer.php | 3 +++ app/Traits/GeneratesPdfTrait.php | 2 +- resources/views/app/pdf/estimate/estimate1.blade.php | 4 ++-- resources/views/app/pdf/estimate/estimate2.blade.php | 4 ++-- resources/views/app/pdf/invoice/invoice1.blade.php | 2 +- resources/views/app/pdf/invoice/invoice2.blade.php | 4 ++-- resources/views/app/pdf/invoice/invoice3.blade.php | 2 +- tests/Unit/PdfHtmlSanitizerTest.php | 9 +++++++++ 8 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/Support/PdfHtmlSanitizer.php b/app/Support/PdfHtmlSanitizer.php index 95d16558..464eaa3b 100644 --- a/app/Support/PdfHtmlSanitizer.php +++ b/app/Support/PdfHtmlSanitizer.php @@ -19,6 +19,9 @@ final class PdfHtmlSanitizer return ''; } + // Legacy/invalid `
` is dropped by libxml and collapses lines in PDF output; normalize to `
`. + $html = str_replace('
', '
', $html); + $allowedTags = '