Skip to content

Conversation

@shoplando
Copy link
Contributor

@shoplando shoplando commented Sep 30, 2025

What are you adding in this PR?

Solves issue #830
This PR adds support for the snippet Liquid tag to the Liquid HTML parser. The implementation includes:

  • Adding the snippet tag to the grammar in liquid-html.ohm
  • Creating the necessary types and interfaces in the CST and AST stages
  • Adding test cases to verify parsing of snippet blocks with HTML content

The snippet tag allows for reusable content blocks similar to the capture tag, with the syntax:

{% snippet variable_name %}
  <content>
{% endsnippet %}

What's next? Any followup issues?

  • Add documentation link for the snippet tag once available

What did you learn?

Working with block-level Liquid tags requires updates across multiple layers of the parser, from grammar definition to AST transformation and formatting.

Before you deploy

  • I included a minor bump changeset
  • My feature is backward compatible

Copy link
Contributor Author

shoplando commented Sep 30, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@shoplando shoplando force-pushed the include-snippet-in-ohm branch from cc9fb5c to ff32bd1 Compare September 30, 2025 13:48
@shoplando shoplando marked this pull request as ready for review September 30, 2025 13:48
@shoplando shoplando requested a review from a team as a code owner September 30, 2025 13:48
@shoplando shoplando force-pushed the include-snippet-in-ohm branch from ff32bd1 to 782619c Compare September 30, 2025 13:49
Copy link
Contributor

@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful 👌

@shoplando shoplando force-pushed the include-snippet-in-ohm branch from 782619c to d2d4afb Compare September 30, 2025 19:42
Copy link
Contributor

@aswamy aswamy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comments, but makes sense! Good stuff 👏

@shoplando shoplando force-pushed the include-snippet-in-ohm branch from d2d4afb to be6edd1 Compare October 1, 2025 19:21
Copy link
Contributor

@karreiro karreiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR, @shoplando! As soon as we fix that minor issue in the unit test, I believe we will be ready to merge 🚀 :)

…html syntax error theme check test to pass CI
Copy link
Contributor Author

shoplando commented Oct 14, 2025

Merge activity

  • Oct 14, 1:52 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 14, 1:53 PM UTC: @shoplando merged this pull request with Graphite.

@shoplando shoplando merged commit 69282bb into main Oct 14, 2025
12 checks passed
@shoplando shoplando deleted the include-snippet-in-ohm branch October 14, 2025 13:53
@shoplando shoplando added the #gsd: 48097 Inline Snippets label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd: 48097 Inline Snippets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants