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

Fix Liquid capture sorting #135

Merged
merged 2 commits into from Mar 22, 2023
Merged

Fix Liquid capture sorting #135

merged 2 commits into from Mar 22, 2023

Conversation

thecrypticace
Copy link
Contributor

The current approach doesn't uniformly change all sources in all AST nodes. This results in weird behavior where only the first or last tag may end up sorted.

Because we're somewhat relying on implementation details here (the use of .source + .position across various nodes rather than the values embedded in the AST) we want to make sure all changes for all classes are applied across all traversed instances of the source text in the AST.

Fixes #130 (for real this time)

@thecrypticace thecrypticace merged commit 3ebd6d0 into main Mar 22, 2023
bradlc added a commit that referenced this pull request Mar 29, 2023
bradlc added a commit that referenced this pull request Mar 29, 2023
thecrypticace added a commit that referenced this pull request Mar 30, 2023
thecrypticace added a commit that referenced this pull request Mar 31, 2023
* Revert "Revert "Fix Liquid `capture` sorting (#135)" (#140)"

This reverts commit 2aabc3c.

* Fix off-by-1 error when String nodes don’t have quotes

* Refactor

* Add tests

* Simplify test cases

* Update changelog
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.

Class ordering not working in Liquid Capture
1 participant