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

Passing liquid in FilterImpl #277

Closed
almousa1990 opened this issue Dec 6, 2020 · 2 comments
Closed

Passing liquid in FilterImpl #277

almousa1990 opened this issue Dec 6, 2020 · 2 comments

Comments

@almousa1990
Copy link

Hello,

It would be very useful to pass liquid to filter implementation, to allow parsing and rendering filtered object.

Use case:
A translate filter 't' takes a template string like "hello {name}" and a name arg, when current implementation, it not possible parse the string with the given scope.

@harttle
Copy link
Owner

harttle commented Dec 7, 2020

It's easy to add liquid to this, but it maybe not as useful as you think. Since the {% raw %} tag is the only way to escape in Liquid, the following template is invalid:

{{ "hello {{name}}" | render: "foo" }}  // {{ foo }}s are not allowed to be nested

I'll expose the liquid instance to filters anyway.

@harttle harttle closed this as completed in f9f595f Dec 7, 2020
harttle pushed a commit that referenced this issue Dec 7, 2020
# [9.17.0](v9.16.1...v9.17.0) (2020-12-07)

### Bug Fixes

* elsif is not supported for unless, fixes [#268](#268) ([2bbf501](2bbf501))
* enforce string-type pattern in `replace`, fixes [#243](#243) ([c8afa39](c8afa39))
* raw block not ignoring {% characters, fixes [#263](#263) ([a492d8e](a492d8e))

### Features

* passing liquid to FilterImpl, closes [#277](#277) ([f9f595f](f9f595f))
@harttle
Copy link
Owner

harttle commented Dec 7, 2020

🎉 This issue has been resolved in version 9.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

2 participants