Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed up pipe character support in split #23

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

amit777
Copy link
Contributor

@amit777 amit777 commented Oct 30, 2023

Hi, we found a bug when trying to split on a | character

use Template::Liquid;

my $template = Template::Liquid->parse('{% assign fragments = foo | split: "| |" %}{% for fragment in fragments %}frag={{fragment}} {% endfor %}');

print $template->render(foo => "foo| |bar| |baz")

This patch will do negative lookaheads and look behinds to make sure a pipe is not surrounded by quotation marks. It will also quotemeta the split character sequence.

@amit777
Copy link
Contributor Author

amit777 commented Oct 30, 2023

related to ticket #24

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