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

@ -16,7 +16,7 @@ async function prepare(raw) {
const model = Post.create({ id: 42, can_edit: true });
const decoratorHelper = { widget, getModel: () => model };
const $elem = $(`<div>${cooked.string}</div>`);
const $elem = $(`<div>${cooked.toString()}</div>`);
checklistSyntax($elem[0], decoratorHelper);
currentRaw = raw;