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

Allow liquid tag inside liquid tag #1731

Merged
merged 2 commits into from
Jul 10, 2023
Merged

Conversation

Maaarcocr
Copy link
Contributor

@Maaarcocr Maaarcocr commented Jul 6, 2023

why?

matches liquid-c behaviour

how?

just skip the liquid tag if it's inside a liquid tag, it essentially does not change any behaviour as far as I can see.

EDIT: matching the actual liquid-c behaviour we now recursively parse the markup for liquid tags inside liquid tags. I have to decrease the line number by 1 because when tokenizing in liquid tag mode we always up line number by one, but really in this case we are staying in the same line.

@gmalette
Copy link
Contributor

gmalette commented Jul 6, 2023

How confident are you that this is what liquid-c does?

@jg-rp
Copy link
Contributor

jg-rp commented Jul 6, 2023

Hi. As is, this PR would fail the following test case, but pass with liquid-c.

def test_inline_liquid_tag_in_liquid_tag
    assert_template_result('42', <<~LIQUID)
      {%- liquid
        liquid echo 42
      -%}
    LIQUID
  end

@Maaarcocr Maaarcocr merged commit 5e92b3a into master Jul 10, 2023
markglenn added a commit to handlecommerce/liquex that referenced this pull request Apr 26, 2024
Matches to liquid_c and liquid v5.5.0. Also, fix rounding with invalid precision
parameters to better match ruby's version of liquid.

Liquex currently converts {{ 0 | round 'invalid' }} to '0.0'. Ruby rounds this to '0'.

Ref: Shopify/liquid#1731
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants