Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String values should evaluate "first" and "last" #781

Open
sebastienros opened this issue Dec 23, 2024 · 2 comments
Open

String values should evaluate "first" and "last" #781

sebastienros opened this issue Dec 23, 2024 · 2 comments

Comments

@sebastienros
Copy link

Same as size there are other pseudo properties strings should evaluate.
And length is one that LiquidJs supports but is not valid.

Here is from the shopify's site:

image

@jg-rp
Copy link
Contributor

jg-rp commented Dec 23, 2024

Interestingly, using Shopify/Liquid directly instead of via a Shopify store, we get the following:

require 'liquid'

source = <<~LIQUID
  {% assign b = "one" %}
  size:   {{ b.size }}
  length: {{ b.length }}
  first:  {{ b.first }}
  last:   {{ b.last }}
LIQUID

template = Liquid::Template.parse(source)
puts template.render

output


size:   3
length: 
first:  
last:   

@harttle
Copy link
Owner

harttle commented Dec 23, 2024

Thank you two for the investigation. I think we can support this feature in liquidjs, people can’t blame us for not returning nil right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants