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

Joining values fail with the latest version #212

Closed
villesau opened this issue Mar 30, 2020 · 4 comments
Closed

Joining values fail with the latest version #212

villesau opened this issue Mar 30, 2020 · 4 comments
Labels

Comments

@villesau
Copy link

Hi!

Thanks for the great work with the library!

There seems to be a bug with joining values in the latest version.

Following code:

const l = require('liquidjs');
const engine = new l.Liquid();
const result = engine.parseAndRenderSync(
  `value-{{ value | split: " " | join \', value-\'}}`,
  { value: '123 321 123' }
);
console.log(result);

should produce output value-123, value-321, value-123 , but instead it produces value-123 321 123

working version: 9.6.0
failing version: 9.11.7

@harttle
Copy link
Owner

harttle commented Mar 30, 2020

You missed : after join, should be written as:

value-{{ value | split: " " | join \', value-\'}}

Sadly it's a regression but since the feature (I mean allowing omit the comma) is not intended and undocumented it's not marked as BREAKING CHANGES. Also see #208.

@villesau
Copy link
Author

Thank you @harttle. Would it be possible to throw on invalid syntax? Or at least to have a flag for it? It's a bit problematic form usability perspective if it just fails silently.

harttle pushed a commit that referenced this issue Mar 31, 2020
## [9.11.8](v9.11.7...v9.11.8) (2020-03-31)

### Bug Fixes

* throw an error if : omitted unintentionally, [#212](#212), [#208](#208) ([8daf281](8daf281))
@harttle
Copy link
Owner

harttle commented Mar 31, 2020

You're right. An error will be thrown in 9.11.8 and I listed it as a difference with shopify/liquid here.

@villesau
Copy link
Author

@harttle great to hear! And really good job on maintaining the library, very much appreciated!

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

No branches or pull requests

2 participants