You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works as expected when everything is okay. But when there is a mistake in a variable it throws me an error (it's also good).
My request is to add an option to skip variables in case of a parsing error and just return this string.
Example:
If I have a string like this: "Hi, this is {{user.first_name} {{user.last_name}}" it should return me a string like this: "Hi, this is {{user.first_name} Kuzo".
Please, let me know if it's possible.
Thanks
Roman Kuzo
The text was updated successfully, but these errors were encountered:
There's multiple errors LiquidJS can throw, apart from unmatched {{. Like unmatched {%, invalid filter syntax, etc. Not sure if skipping this one error works for you.
A general advice would be try parse and render, then fallback to a default string, in case of template not trusted.
I generally advice against this as it will introduce unnoticed mistakes and headaches. if you have data entry process and fear that users might not be advanced enough to enter correct format you can run the template through a sample data and show the result and also prevent user from saving until successful compilation
Hey
I'm using this package to interpolate string and insert some data into it.
Example:
I have a string like this: "Hi, this is {{user.first_name}} {{user.last_name}}". And the object of values:
It works as expected when everything is okay. But when there is a mistake in a variable it throws me an error (it's also good).
My request is to add an option to skip variables in case of a parsing error and just return this string.
Example:
If I have a string like this: "Hi, this is {{user.first_name} {{user.last_name}}" it should return me a string like this: "Hi, this is {{user.first_name} Kuzo".
Please, let me know if it's possible.
Thanks
Roman Kuzo
The text was updated successfully, but these errors were encountered: