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

Allow accessing the globals with index without a preceding identifier #560

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

Conversation

imarkkinen
Copy link

@imarkkinen imarkkinen commented Sep 15, 2024

Fixes #543

let parser = liquid::ParserBuilder::with_stdlib().build().unwrap();
let tpl = parser.parse("{{['other']}}").unwrap();
let globals = liquid::object!({
        "my": {"variable": "value"}, "other": "other_value"
     });
 let res = tpl.render(&globals).unwrap();
// "other_value"

Currently the above fails as it's not considered valid liquid markup in liquid-rust.

  • Tests created for any new feature or regression tests for bugfixes.

@imarkkinen imarkkinen marked this pull request as ready for review September 15, 2024 08:26
@imarkkinen imarkkinen changed the title Allow accessing the root value with index without a preceding identifier Allow accessing the globals with index without a preceding identifier Sep 16, 2024
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.

Index access to globals produces parse error
1 participant