Nunjucks: String concatenation doesn't seem to work inside function calls

Created on 28 Jun 2013  路  6Comments  路  Source: mozilla/nunjucks

{% set url = media('/docs/privacy/' + language + '.html') %}

The above expression throws a parse error locally:

parseSignature: expected comma after expression

Investigating to try to figure out what might be wrong.

bug

Most helpful comment

The + operator should work fine.

All 6 comments

Did you ever figure it out?

I haven't, but I'll take a look this week.

Is this still an issue? @mattbasta

I don't know, I haven't used Nunjucks in any projects for almost a year now. It's doubtful that it's still an issue, though.

Hi guys, do you know what is the operator to concatenate strings?
Looks like the only way is to use the "replace" filter: 'my string _str2' | replace('_str2', string2)

The + operator should work fine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

decibyte picture decibyte  路  6Comments

boutell picture boutell  路  6Comments

wslx520 picture wslx520  路  4Comments

atian25 picture atian25  路  5Comments

RomainLanz picture RomainLanz  路  4Comments