Skip to content
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

Malformed HTML Entities in Ember Templates #20736

Closed
ben-crowhurst opened this issue Aug 29, 2024 · 4 comments
Closed

Malformed HTML Entities in Ember Templates #20736

ben-crowhurst opened this issue Aug 29, 2024 · 4 comments

Comments

@ben-crowhurst
Copy link

🐞 Describe the Bug

Ember (Handlebars?) fails to parse HTML entities, inserting unknown character code symbols <?>.

🔬 Minimal Reproduction

Create a new handlebars template with the four following anchor elements:

/* Fail */
<a class="close" href="#" {{on "click" @hide}}>&times;</a>

/* Pass */
<a {{on "click" @hide}} class="close" href="#">&times;</a>
<a class="close" href="#" {{on "click" @hide}}> &times; </a>
<a class="close" href="#" {{on "click" @hide}}>&times;&times;</a>

😕 Actual Behavior

Unknown character code symbols appear in the browser where the HTML entity should be presented.

🤔 Expected Behavior

Given &times;
Then I should see ×

🌍 Environment

  • Ember: - 5.10
  • Ember-CLI: - 5.10.0
  • Node.js/npm: - 22.7.0
  • OS: - GNU/Linux 6.8.0-76060800daily20240311-generic PopOS 22.04.
  • Browser: - Firefox 128.0 (64-bit).
@NullVoxPopuli
Copy link
Contributor

This is actually a node issue. Can you downgrade to 22.6 or earlier?

@ben-crowhurst
Copy link
Author

ben-crowhurst commented Aug 29, 2024

Oh! that really intrigues me. Do you have a Node issue I can dive deeper into? I'd love to understand the cause.

Yes, we can downgrade, thanks.

We chose to move the on-click handler to the front of the element and made a doco reference locally.

@ben-crowhurst
Copy link
Author

Happy to close this issue as an upstream vendor offender.

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

No branches or pull requests

2 participants