ember-cli-string-helpers icon indicating copy to clipboard operation
ember-cli-string-helpers copied to clipboard

SafeString bug: Replace all use of string.string with string.toString()

Open eelke opened this issue 6 months ago • 0 comments

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()

eelke avatar Aug 14 '24 15:08 eelke