Skip to content

fix: stop relying on the removed Ember.Handlebars global for escaping - #1

Open
eyupatis wants to merge 1 commit into
chore/ember_4from
fix/ember-6-escape-expression
Open

fix: stop relying on the removed Ember.Handlebars global for escaping#1
eyupatis wants to merge 1 commit into
chore/ember_4from
fix/ember-6-escape-expression

Conversation

@eyupatis

Copy link
Copy Markdown

Summary

Ember 6 removes the Ember.Handlebars namespace entirely. The {{linkify}} helper still calls Ember.Handlebars.Utils.escapeExpression(params[0]) directly with no fallback, which throws at render time for any consumer on Ember >= 6.

This bug is not fixed in any upstream release (checked all 24 npm versions up to 4.1.2) or in the most recent open upstream PR (johnotander/ember-linkify#43).

Proposed solution

Replace the call with Handlebars' own well-known escaping implementation, copied verbatim. Drops the now-unused Ember import.

How to test this

ember test --filter linkify — 16/16 pass, including the two tests that exercise HTML escaping directly.

Ember 6 drops the Ember.Handlebars namespace entirely, so
Ember.Handlebars.Utils.escapeExpression throws at render time for any
consumer on Ember >= 6. Replace it with Handlebars' own well-known
escaping implementation, copied verbatim, and drop the now-unused
Ember import.
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