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
I am trying to escape a code snippet that includes the {% characters using {% raw %} and {% endraw %} but even inside the playground this breaks. It looks like the {% characters are breaking the parser, so the raw/endraw block is not doing what I expect it to do.
{% raw %}
This is a code snippet showing how {% breaks the raw block.
{% endraw %}
If relevant, I have attached the code I am using outside of the playground although it is very basic (mostly a copy/paste from the liquidjs documentation):
import { Liquid } from "liquidjs";
const liquidEngine = new Liquid();
// largeContent is the text in the left console window from the playground link above.
const template = liquidEngine.parse(largeContent);
const rawContent = liquidEngine.renderSync(template); // fails at this stage.
I'm using version 9.16.1 of liquidjs:
"liquidjs": "^9.16.1",
If you are supposed to escape this then I can't find information in the documentation (maybe include it near the documentation describing the use of the raw/endraw block?). However, I do believe this is a bug because the raw block should make everything raw and ONLY switch back when it encounters the closing endraw tag. I have used this same "largeContent" yaml template in an ASP.Net app in the past and used a NuGet package version of the liquid engine but for C# and this used to work as expected. Only since I migrated the code to JavaScript and used this package as an alternative has this bug emerged.
Thank you for your time and hard work :)
The text was updated successfully, but these errors were encountered:
I am trying to escape a code snippet that includes the
{%
characters using{% raw %}
and{% endraw %}
but even inside the playground this breaks. It looks like the{%
characters are breaking the parser, so the raw/endraw block is not doing what I expect it to do.See this example inside the playground, or the code snippet below:
If relevant, I have attached the code I am using outside of the playground although it is very basic (mostly a copy/paste from the liquidjs documentation):
I'm using version 9.16.1 of liquidjs:
"liquidjs": "^9.16.1",
If you are supposed to escape this then I can't find information in the documentation (maybe include it near the documentation describing the use of the raw/endraw block?). However, I do believe this is a bug because the
raw
block should make everything raw and ONLY switch back when it encounters the closingendraw
tag. I have used this same "largeContent" yaml template in an ASP.Net app in the past and used a NuGet package version of the liquid engine but for C# and this used to work as expected. Only since I migrated the code to JavaScript and used this package as an alternative has this bug emerged.Thank you for your time and hard work :)
The text was updated successfully, but these errors were encountered: