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

Multiline strings in calls and sets don't work #84

Closed
joshuataylor opened this issue Sep 1, 2022 · 0 comments · Fixed by #85
Closed

Multiline strings in calls and sets don't work #84

joshuataylor opened this issue Sep 1, 2022 · 0 comments · Fixed by #85

Comments

@joshuataylor
Copy link
Sponsor Contributor

Description

{{ 'hello
world' }}

Should output:

hello
world

And

{% set foo = 'hello
world' %}
{{ foo }}

Should output:


hello
world

[What happened]

called `Result::unwrap()` on an `Err` value: Error { kind: SyntaxError, detail: Some("unexpected end of string"), name: Some("set.txt"), lineno: 22, source: None }

---------------------------- Template Source -----------------------------
  19 | {% if true %}{% set foo = "was true" %}{% endif %}
  20 | {{ foo }}
  21 | 
  22 > {{"hello
  23 | world"}}
--------------------------------------------------------------------------

thread 'test_vm' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: SyntaxError, detail: Some("unexpected end of string"), name: Some("set.txt"), lineno: 22, source: None }

---------------------------- Template Source -----------------------------
  19 | {% if true %}{% set foo = "was true" %}{% endif %}
  20 | {{ foo }}
  21 | 
  22 > {{"hello
  23 | world"}}
--------------------------------------------------------------------------
', minijinja/tests/test_templates.rs:37:58
stack backtrace:

Additional helpful information:

What did you expect

It would not error :)

I believe this is due to https://github.com/mitsuhiko/minijinja/blob/main/minijinja/src/lexer.rs#L127 , I'm unsure if it'll break anything by removing it?

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

Successfully merging a pull request may close this issue.

1 participant