DEV: Future-proof htmlSafe interactions (#23596)

See https://github.com/discourse/discourse-encrypt/pull/282

> `cooked` was an Ember SafeString. The internal storage of the string changed from `.string` to `.__string` at some point between Ember 3.28 and Ember 5. Instead, we can use `toString()` which is guaranteed to work in all situations
This commit is contained in:
Jarek Radosz
2023-09-14 23:04:57 +02:00
committed by GitHub
parent ed8d0656f9
commit c75b379d6f
7 changed files with 13 additions and 11 deletions

View File

@ -6,6 +6,8 @@ export default Component.extend({
this._super(...arguments);
const contents = $(this.element).html();
cookAsync(contents).then((cooked) => $(this.element).html(cooked.string));
cookAsync(contents).then((cooked) =>
$(this.element).html(cooked.toString())
);
},
});