How do Shopify/Liquid and shopify.dev differ? #1881
-
I am often using the code blocks in https://shopify.dev/docs/api/liquid#liquid_basics to test some snippets of liquid. However it seems like the results vary with this repository. Here is an example, where Another example is identifiers, where on the shopify.dev you can use What are the reasons for these differences? Which one is correct? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
As far as liquid/lib/liquid/variable_lookup.rb Line 70 in 323951b Best guess (hopefully someone at Shopify will correct me if I’m wrong), strings on shopify.dev are active support strings, which do respond to So it’s the string objects that are different, not the Liquid engine. 🤷 |
Beta Was this translation helpful? Give feedback.
As far as
first
andlast
go, they are handled here:liquid/lib/liquid/variable_lookup.rb
Line 70 in 323951b
Best guess (hopefully someone at Shopify will correct me if I’m wrong), strings on shopify.dev are active support strings, which do respond to
first
andlast
. Where as standard Ruby strings don’t.So it’s the string objects that are different, not the Liquid engine. 🤷