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

Using new line as blockEnd tag don’t work #1417

Open
DevOpsCraftsman opened this issue Oct 25, 2022 · 0 comments
Open

Using new line as blockEnd tag don’t work #1417

DevOpsCraftsman opened this issue Oct 25, 2022 · 0 comments

Comments

@DevOpsCraftsman
Copy link

DevOpsCraftsman commented Oct 25, 2022

I’m trying to use a "blade" (from laravel) like syntaxe, but without success:

const nunjucks = require("nunjucks")
nunjucks.configure("", {
    tags: {
        blockStart: "@",
        blockEnd: "\n",
    }
})

nunjucks.renderString(`
@if 'a' == 'b'
  <p>Yes</p>
@endif
`)
Template render error: (unknown path) [Line 3, Column 12]
  unexpected token: /

And with:

nunjucks.renderString(`
@if 'a' == 'b'
  a
@endif
`)
Template render error: (unknown path) [Line 4, Column 1]
  expected block end in if statement

I think the parser can’t handle it properly for some reason…

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

No branches or pull requests

1 participant