ember-cli-string-helpers
ember-cli-string-helpers copied to clipboard
SafeString bug: Replace all use of string.string with string.toString()
I noticed truncate
did not work correctly after updating an older project, and after poking around I found the culprit.
In a couple of locations the code checks if a string is a safe string:
if (isHTMLSafe(string)) {
string = string.string;
}
That may have been okay-ish in the past, it no longer works with Glimmer.
The internal variable in SafeString class is now called __string
, and in order to return it as a regular string you need to call string.toString()