Malformed HTML Entities in Ember Templates
🐞 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}}>×</a>
/* Pass */
<a {{on "click" @hide}} class="close" href="#">×</a>
<a class="close" href="#" {{on "click" @hide}}> × </a>
<a class="close" href="#" {{on "click" @hide}}>××</a>
😕 Actual Behavior
Unknown character code symbols appear in the browser where the HTML entity should be presented.
🤔 Expected Behavior
Given ×
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).
This is actually a node issue. Can you downgrade to 22.6 or earlier?
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.
- https://github.com/nodejs/node/issues/54521
- https://github.com/nodejs/node/issues/54628
- https://github.com/nodejs/node/issues/54543
- https://github.com/nodejs/node/issues/54518
Happy to close this issue as an upstream vendor offender.