Skip to content

Fix HTML entities showing in support form#374

Merged
simonhamp merged 1 commit intomainfrom
fix-support-form-entities
May 8, 2026
Merged

Fix HTML entities showing in support form#374
simonhamp merged 1 commit intomainfrom
fix-support-form-entities

Conversation

@simonhamp
Copy link
Copy Markdown
Member

Summary

The customer support request form was rendering literal HTML entities in the UI:

  • Product card descriptions on step 1 showed & (e.g. "iOS & Android apps") because passing an interpolated value to a Flux component attribute (description="{{ $product['desc'] }}") ends up double-encoding — {{ }} runs e() once, then the component template echoes it through {{ }} again.
  • The "Steps to reproduce" textarea placeholder used 
 HTML entity references, which under some render paths come through as literal text rather than newlines.
  • The reply hint on the ticket show page used ⌘ for the Mac Command symbol with the same risk.

Changes

  • resources/views/livewire/customer/support/create.blade.php
    • Replaced & with and in the product card descriptions to dodge the Flux double-escape entirely.
    • Switched placeholder="… 
 …" to a :placeholder="implode(PHP_EOL, [...])" binding so newlines render reliably.
  • resources/views/livewire/customer/support/show.blade.php
    • Replaced ⌘ with the literal character in the reply hint.
  • tests/Feature/SupportFormPlaceholderTest.php
    • Added a regression test asserting the placeholder no longer contains 
 and renders real newlines.

Test plan

  • php artisan test --compact tests/Feature/SupportTicketTest.php tests/Feature/SupportFormPlaceholderTest.php — all 83 tests pass
  • Verified visually in the browser: product card descriptions and placeholder lines render correctly with no entities

🤖 Generated with Claude Code

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) <noreply@anthropic.com>
@simonhamp simonhamp marked this pull request as ready for review May 8, 2026 13:25
@simonhamp simonhamp merged commit c0c2c6c into main May 8, 2026
2 checks passed
@simonhamp simonhamp deleted the fix-support-form-entities branch May 8, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant