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.)
I'm wary of introducing a difference from the Shopify specification. Aside from this, this seems like an improvement, that would be useful for users who are not concerned about compatibility with the specification and with other implementations.
How about if this is controlled by a flag or option, that defaults to false?
This could be a (new) configuration parameter on NewEngine, or ParseString / ParseTemplate / ParseTemplateLocation.
Checklist
IsTemplateError
returns false.)Expected Behavior
output
Actual Behavior
Syntax Error
Detailed Description
ref. #5
The Shopify specification does not allow escaping of characters in string literals.
https://shopify.github.io/liquid/basics/types/#string
But this is inconvenient for me.
Possible Solution
The proposal makes it escapable when ``.
Shopify/liquid#1174
This my branch uses
strconv.Unquote
to escape only double-quoted.master...tuchida:escape-string
In this implementation, it seems that only
\'
and\"
can be escaped.https://github.com/acstech/liquid/blob/5bcb5c9b2d87dbd09e8a08889477167721e09edf/core/parser.go#L135-L136
If you want to support escaping, you can decide on the specification and I will create a Pull Request.
The text was updated successfully, but these errors were encountered: