You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Why issue created? Because ember in-tempalte if already counting empty SafeString as false, but there is no official js way to check for empty safe string.
I think, we could workaround this case, extending SafeString class, adding length getter.
exportclassSafeStringimplementsGlimmerSafeString{private__string: string;constructor(string: string){this.__string=string;}/** getter to fix isEmpty case*/getlength(){returnthis.__string.length;}/** Get the string back to use as a string. @public @method toString @returns {String} The string marked as trusted */toString(): string{return`${this.__string}`;}/** Get the wrapped string as HTML to use without escaping. @public @method toHTML @returns {String} the trusted string, without any escaping applied */toHTML(): string{returnthis.toString();}}
The text was updated successfully, but these errors were encountered:
If we use builtin
isEmpty
on emptySafeString
instance, we getting incorrect result.Wondering if we should update
isEmpty
to supportSafeString
...Real life use case for error:
Reproduction: https://limber.glimdown.com/edit?c=AYjmCsGcAIBsEsBuBTaAHATsx9kHcAoeAWzQHsMAXaAYTNLIDtlHqAzDe6AcgAFQExYsgwB6AMb1yzVtwDcRBlWgBvaAAtKxWAGUAhm1QBfaBy59kxAEYjRlS2lh778xeWVr4kAKKlKAT2gTM2IeXksbMQBXSnhYSFcCZAAPd2oAE2Q2PSjYanEnSBgACWRYWDIAdQpYdOgU%2B0Z0mDoGGWoVAgJoer9-fUMdSgx4RlBoAF4NLV0DZAAKbm4ASgUexiZfNACB5CGRscnp7V3FjcotgJWFbuhQZGovS-65-dHQeeXVW56sSiiMIxoE8%2BvNKOovAA6Bw7V7Dd6rW5GLo9AA89lITnsAD4uj9oKj1ABmbGlWBoETQcR6SDIVGiYm4no9fEqFQAYngbGg4KhIO2L0G8LGRmRzPF0EgwvGXl6Ap6AG1JBgsOJKABdVkqMq00X4iVSg4ymDnOUBRWjZWqjVa0RcvX41FWDC4x2MgBCuViQIAkty8PBwdBnrs3mN6YyURK2ZzubzINC%2BqHpXqJcyYYFIHNJdLgTAcJB4FZYKgFZaKNbNWm2TrkKm02bM7nZaaC0WS9AlRXkGqq9GVHa2PWJY7na7xYSSZ68qM888qTTUAGg%2BoyhSMBGSVHmTGudB5vzzfHEwLk0blsOJRmc0a89BW1526WrT2bQ39aptfE62KG9es4YN7vHebbFqW5Yqq%2Bfbimyg4OmmToutuBIerks57su6j3kwjbQGe7ybkyzIfrucYQgmGyMCGcJGpe4qUdRQq3gBqCGsBsqgR2XaQb2JFfrqv5pgxSY0cBbGHC2ZDUJx4GMC%2BvHVgO9qCcR4q3PSGKOM4yC4siIDAAQQA&format=glimdown
Why issue created? Because ember in-tempalte
if
already counting emptySafeString
asfalse
, but there is no officialjs
way to check for empty safe string.I think, we could
workaround
this case, extendingSafeString
class, addinglength
getter.The text was updated successfully, but these errors were encountered: