romulomachado / ember-cli-string-helpers

Set of the String helpers extracted from DockYard's ember-composable-helpers.
Other
74 stars 30 forks source link

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

Open eelke opened 1 month ago

eelke commented 1 month ago

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