Skip to content

Commit

Permalink
Fix left matches repr of argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
jg-rp committed Dec 13, 2023
1 parent a256590 commit febc54c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion liquid/future/filters/_split.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def split(val: str, sep: str) -> List[str]:
if not val:
return []

sep = soft_str(sep)
if val == sep:
return []

return val.split(soft_str(sep))
return val.split(sep)
9 changes: 9 additions & 0 deletions liquid/golden/split_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,13 @@
expect="",
future=True,
),
Case(
description="left matches string repr of argument",
template=(
r'{% assign a = "1" | split: 1 %}'
r"{% for i in a %}{{ forloop.index0 }}{{ i }}{% endfor %}"
),
expect="",
future=True,
),
]

0 comments on commit febc54c

Please sign in to comment.