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
I have tested my example against Shopify Liquid. (This isn't necessary if the actual behavior is a panic, or an error for which IsTemplateError returns false.)
Expected Behavior
Return the number of characters instead of the number of bytes when using the size filter on a string.
Actual Behavior
The current implementation returns the number of bytes when using size on a string.
Detailed Description
Shopify's liquid counts number of characters instead of number of bytes when using the size filter on a string, e.g.:
{{ "Straße" | size }} // -> 6, even though "ß" is encoded as a sequence of two bytes, so `len("Straße") = 7`.
Possible Solution
Return the rune count instead of the number of bytes when using size on a string.
The text was updated successfully, but these errors were encountered:
Checklist
IsTemplateError
returns false.)Expected Behavior
Return the number of characters instead of the number of bytes when using the
size
filter on a string.Actual Behavior
The current implementation returns the number of bytes when using
size
on a string.Detailed Description
Shopify's liquid counts number of characters instead of number of bytes when using the
size
filter on a string, e.g.:Possible Solution
Return the rune count instead of the number of bytes when using
size
on a string.The text was updated successfully, but these errors were encountered: