Skip to content
Discussion options

You must be logged in to vote

The second argument to parseAndRender() can be an instance of Context, which might do what you need.

import { Liquid, Context } from "liquidjs";

const engine = new Liquid();

const data = new Context({ param: "{{ foo }}", foo: 42 });
const template = `{{ param }}`;

const intermediate_result = await engine.parseAndRender(template, data);
console.log(intermediate_result);

engine.parseAndRender(intermediate_result, data).then(console.log);

If I've understood your requirements correctly, I can imagine a single pass solution that involves wrapping your data (strings that contain additional markup) in a custom drop class. If your drop class has a reference to an instance of Liquid and Context,…

Replies: 6 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@ilg-ul
Comment options

Answer selected by ilg-ul
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ilg-ul
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ilg-ul
Comment options

@ilg-ul
Comment options

Comment options

You must be logged in to vote
3 replies
@ilg-ul
Comment options

@jg-rp
Comment options

@ilg-ul
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants