Skip to content

Apostrophe not being escaped in markdown mail templates #54830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
seb-jones opened this issue Feb 27, 2025 · 0 comments
Open

Apostrophe not being escaped in markdown mail templates #54830

seb-jones opened this issue Feb 27, 2025 · 0 comments
Labels

Comments

@seb-jones
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants