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

raw/endraw block not ignoring {% characters #263

Closed
Mike-Logit opened this issue Oct 22, 2020 · 1 comment
Closed

raw/endraw block not ignoring {% characters #263

Mike-Logit opened this issue Oct 22, 2020 · 1 comment

Comments

@Mike-Logit
Copy link

Mike-Logit commented Oct 22, 2020

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:

{% 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 :)

@harttle harttle added the bug label Nov 8, 2020
@harttle harttle closed this as completed in a492d8e 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