Shopify / Shopify/liquid

Multiline Filters

Open
#1,703 6 comments 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description


I assume there already is a related issue,
but I wasn't able to find it if it exists.


Suggestion

Allow multiline filters in liquid blocks

{% liquid

    # Showcase of multiline goodness

    assign value = 'this-is-a-test'
        | split : '-'
        | uniq
        | sort_natural
        | join : ' '

%}

Reasoning

This would allow people to write cleaner, more structured
code that doesn't rely on the overuse of {% tag %} blocks
and would make writing 'pure code' a much easier task.


Extended

The same would be for parameters as well

{% liquid

    render 'snippet'
        , a : a
        , b : b

%}


Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the multiline {% liquid %} examples in the issue and trace how Liquid blocks, filters, and render parameters are parsed. Define the accepted multiline syntax and verify that the filter-chain and parameter examples parse and preserve their intended behavior, while checking existing syntax tests if you locate them.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.