Skip to content

Support colon syntax in where modifier - #5499

Merged
jasonvarga merged 1 commit into
masterfrom
fix/where-modifier-compat
Mar 15, 2022
Merged

Support colon syntax in where modifier#5499
jasonvarga merged 1 commit into
masterfrom
fix/where-modifier-compat

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

Since #5477 "fixes" the inconsistency with how modifier parameters work (#3614), I'm sure plenty of people using the where modifier as documented will run into an issue.

This PR lets the where modifier continue to work if you use the colon syntax:

{{ myarray where="foo:bar" }}
  ...
{{ /myarray }}

Technically that's a single argument of "foo:bar" which we'll just split.
If you do it the "right" way (where="foo|bar") it'll be considered two arguments ("foo" and "bar") and work fine too.

Tip: you can use the new modifier syntax to avoid all the confusion entirely:

{{ myarray | where('foo', 'bar') }}
  ...
{{ /myarray }}

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.

1 participant