Apostrophe not being escaped in markdown mail templates · Issue #54830 · laravel/framework · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Apostrophe not being escaped in markdown mail templates #54830

Closed
@seb-jones

Description

@seb-jones

Laravel Version

12

PHP Version

8.4

Database Driver & Version

N/A

Description

Hi,

We are finding that variables echoed into Markdown Mailables are not having the Apostrophe character escaped. This has created some confusion in tests because assertSeeInHtml does escape the Apostrophe character.

Is this expected behaviour?

Steps To Reproduce

  1. Create a new Laravel 12 installation.

  2. Create a Markdown Mailable, e.g:

php artisan make:mail EscapeTest --markdown=mail.escape-test
  1. In the markdown file, echo some characters that you would expect to be escaped, including the Apostrophe:
<x-mail::message>

{{ "<script ' &" }}

</x-mail::message>
  1. Return the mailable from the / web route for testing:
Route::get('/', function () {
    return new \App\Mail\EscapeTest;
});
  1. Navigate to the website in the browser and observe in Dev Tools that the Apostrophe character is not escaped, while the other characters are:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      TMZ Celebrity News – Breaking Stories, Videos & Gossip

      Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

      Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

      🎥 Watch TMZ Live

      TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.