Context: I have a select2 component displaying some html markup in the selection / options (icons or country flags). This was working fine in ember-1.9.1 but broke in ember-canary (1.12.0-beta.1+canary.88e24ff2) I have these two test cases:
- Good with ember 1.9.1 and no SafeString. You can see here that plain strings work, SafeStrings don't
- Bad with ember-canary and SafeString: you can see that neither plain strings nor SafeStrings produce any html markup in the select2 component.
In the test cases I am showing a plain select view (where the html string should be visible) and a select2 view (where it should be converted to html markup)
Apparently the fact that it was working in 1.9.1 (and all previous releases) was a side-effect of a bug in ember, which has been "fixed": in order for this to work in future releases, we must pass SafeStrings. Fair enough. But this is not correct! In ember-canary, neither plain strings nor safe strings will be passed to the ember view. The html markup is silently removed (even from SafeStrings!)
The question is: why is ember-canary removing the html markup? It does not matter if it is a SafeString or not, the html markup gets removed. Is this a bug, or intended? Why? A SafeString is a SafeString!
And, above all, what can I do to get my select2 component displaying again the html markup?
For more context, I have filed an issue, but it has been marked as closed.
Aucun commentaire:
Enregistrer un commentaire