From faffabc970f70c17cd1b8801dc85b356caa681b6 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Fri, 8 May 2026 12:15:21 +0100 Subject: [PATCH] Fix HTML entities rendering in support form MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The product card descriptions on the support request form were showing literal "&" because passing interpolated attribute values to a Flux component re-escapes them. Replaced "&" with "and" to dodge the double-encoding entirely. Also replaced raw " " entities in the Steps to Reproduce placeholder with PHP_EOL via attribute binding so newlines render reliably, and swapped the "⌘" entity in the reply hint for the literal "⌘" character. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../customer/support/create.blade.php | 10 ++--- .../livewire/customer/support/show.blade.php | 2 +- tests/Feature/SupportFormPlaceholderTest.php | 37 +++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 tests/Feature/SupportFormPlaceholderTest.php diff --git a/resources/views/livewire/customer/support/create.blade.php b/resources/views/livewire/customer/support/create.blade.php index 70c59475..17ab44b8 100644 --- a/resources/views/livewire/customer/support/create.blade.php +++ b/resources/views/livewire/customer/support/create.blade.php @@ -35,11 +35,11 @@ @foreach ([ - 'mobile' => ['label' => 'Mobile', 'desc' => 'iOS & Android apps'], - 'desktop' => ['label' => 'Desktop', 'desc' => 'macOS, Windows & Linux apps'], - 'nativephp.com' => ['label' => 'nativephp.com', 'desc' => 'Website, account & billing'], + 'mobile' => ['label' => 'Mobile', 'desc' => 'iOS and Android apps'], + 'desktop' => ['label' => 'Desktop', 'desc' => 'macOS, Windows and Linux apps'], + 'nativephp.com' => ['label' => 'nativephp.com', 'desc' => 'Website, account and billing'], ] as $value => $product) - + @endforeach @@ -105,7 +105,7 @@ wire:model="reproductionSteps" label="Steps to reproduce" rows="4" - placeholder="1. Open the app 2. Navigate to... 3. Click on..." + :placeholder="implode(PHP_EOL, ['1. Open the app', '2. Navigate to...', '3. Click on...'])" /> diff --git a/resources/views/livewire/customer/support/show.blade.php b/resources/views/livewire/customer/support/show.blade.php index 30ba8dc8..9e49b9dc 100644 --- a/resources/views/livewire/customer/support/show.blade.php +++ b/resources/views/livewire/customer/support/show.blade.php @@ -133,7 +133,7 @@
- ⌘/Ctrl + Enter to send + ⌘/Ctrl + Enter to send Send Reply diff --git a/tests/Feature/SupportFormPlaceholderTest.php b/tests/Feature/SupportFormPlaceholderTest.php new file mode 100644 index 00000000..14741f49 --- /dev/null +++ b/tests/Feature/SupportFormPlaceholderTest.php @@ -0,0 +1,37 @@ + 'price_test_max_yearly']); + $user = User::factory()->create(); + License::factory()->max()->active()->create(['user_id' => $user->id]); + Subscription::factory()->for($user)->active()->create([ + 'stripe_price' => 'price_test_max_yearly', + ]); + + $html = Livewire::actingAs($user) + ->test(Create::class) + ->set('selectedProduct', 'mobile') + ->call('nextStep') + ->html(); + + $this->assertStringNotContainsString(' ', $html); + $this->assertStringContainsString("1. Open the app\n2. Navigate to...\n3. Click on...", $html); + } +}