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

Invalid template seems to parse fine #519

Closed
amit777 opened this issue Jul 12, 2022 · 3 comments
Closed

Invalid template seems to parse fine #519

amit777 opened this issue Jul 12, 2022 · 3 comments

Comments

@amit777
Copy link
Contributor

amit777 commented Jul 12, 2022

Hi, I'm wondering if the the following code would be expected to throw an error while parsing a liquid template. I would have expected parse to fail, however, I only get an error when trying to call render.:

Note, the template is invalid because the URL is not enclosed in quotes.

import { Liquid } from 'liquidjs'
const engine = new Liquid()

// I would expect error to get thrown on this parse line
const tpl = engine.parse('{% assign headshot = https://testurl.com/not_enclosed_in_quotes.jpg %}')

// Error gets thrown by following line
engine.render(tpl, {}).then(console.log)

I only get a RenderError

unexpected token at "://testurl.co...", line:1, col:1
>> 1| {% assign headshot = https://testurl.com/not_enclosed_in_quotes.jpg %}
RenderError: unexpected token at "://testurl.co...", line:1, col:1
@harttle harttle added the bug label Jul 13, 2022
@dysfunc
Copy link

dysfunc commented Jul 14, 2022

+1

github-actions bot pushed a commit that referenced this issue Jul 14, 2022
## [9.39.1](v9.39.0...v9.39.1) (2022-07-14)

### Bug Fixes

* throw ParseError instead of RenderError for invalid assign expression, closes [#519](#519) ([c41a5d5](c41a5d5))
@github-actions
Copy link

🎉 This issue has been resolved in version 9.39.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@amit777
Copy link
Contributor Author

amit777 commented Jul 14, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants