Skip to content

Fix class sorting in capture liquid tag#131

Merged
thecrypticace merged 3 commits intomainfrom
fix/liquid-tag-sorting
Mar 17, 2023
Merged

Fix class sorting in capture liquid tag#131
thecrypticace merged 3 commits intomainfrom
fix/liquid-tag-sorting

Conversation

@thecrypticace
Copy link
Copy Markdown
Contributor

Fixes #130

The Liquid prettier plugin consults the `source` property on various nodes when re-printing the AST as text. Which one gets looked at depends on what type of node is being analyzed and even what ancestor nodes there are. For instance, attributes consult the `source` on the attribute node. But some Liquid Tags end up looking at the source property of the liquid tag instead of the nodes inside it even if they’re modified (for the purposes of attrbute sorting at least).

This new setup allows us to push objects with `source` properties that can all be updated simultanously when sorting the value of an attribute.
@thecrypticace thecrypticace merged commit b207705 into main Mar 17, 2023
bronisMateusz pushed a commit to bronisMateusz/prettier-plugin-tailwindcss-drupal that referenced this pull request Apr 16, 2025
* Refactor liquid script attribute sorting

The Liquid prettier plugin consults the `source` property on various nodes when re-printing the AST as text. Which one gets looked at depends on what type of node is being analyzed and even what ancestor nodes there are. For instance, attributes consult the `source` on the attribute node. But some Liquid Tags end up looking at the source property of the liquid tag instead of the nodes inside it even if they’re modified (for the purposes of attrbute sorting at least).

This new setup allows us to push objects with `source` properties that can all be updated simultanously when sorting the value of an attribute.

* Fix class sorting in `capture` liquid tag

* 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