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

Issue with JSON/list parsing in certain cases #50

Closed
frikky opened this issue Oct 27, 2022 · 3 comments · Fixed by #51
Closed

Issue with JSON/list parsing in certain cases #50

frikky opened this issue Oct 27, 2022 · 3 comments · Fixed by #51
Labels
bug Something isn't working

Comments

@frikky
Copy link

frikky commented Oct 27, 2022

Hey again!

We've had some trouble recently with complex data, and I've been trying to figure out a very simple example that breaks if done wrong. Here goes:

  1. Open up the playground https://pwwang.github.io/liquidpy/playground/
  2. Set version to "Wild"
  3. Paste in the following. This works entirely as expected!
{{ [{"id": "1"}] | size }}

{{ a | upper }}
  1. Now, let's do a little switcheroo. This seems to break somehow, and I'm not sure where or how to look for a fix.
{{ a | upper }}

{{ [{"id": "1"}] | size }}

This seems to only be the case when trying to handle JSON within a list, and doing it AFTER another filter has been used previously. The main place we see issues with it is if you e.g. try to use the "size" filter multiple times, and it contains JSON.

Cheers - please tell me how we can help :)

@pwwang pwwang added the bug Something isn't working label Oct 27, 2022
pwwang added a commit that referenced this issue Oct 27, 2022
@pwwang pwwang mentioned this issue Oct 27, 2022
pwwang added a commit that referenced this issue Oct 27, 2022
* 🐛 Fix JSON/list parsing in certain cases (#50)

* 🔖 0.7.6

* 🐛 Futher fix #50

* Update deps

* Update deps

* Update deps

* 💚 Fix CI

* 💚 Add python 3.10 in CI

* 🔖 0.7.6
@pwwang
Copy link
Owner

pwwang commented Oct 27, 2022

Fixed by 0.7.6.

This is tricky, but a nice catch!

@frikky
Copy link
Author

frikky commented Oct 28, 2022

That was fast!! Glad we're using this project.

Where is the sponsor button? 👀

@pwwang
Copy link
Owner

pwwang commented Oct 28, 2022

Hey, thanks for asking! Really appreciate it. But let's see if it can benefit more people in the future.

pwwang added a commit that referenced this issue Mar 22, 2023
* 🐛 Fix JSON/list parsing in certain cases (#50)

* 🔖 0.7.6

* 🐛 Futher fix #50

* Update deps

* Update deps

* Update deps

* 💚 Fix CI

* 💚 Add python 3.10 in CI

* 🔖 0.7.6

* ⬆️ Upgrade deps including markdown, regex, and python-slugify

* 📌 Drop support for python3.6

* 🐛 Fix passing env to Liquid() not working

* 🔖 0.8.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants