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

Support string interpolation #277

tremby opened this issue Dec 10, 2015 · 7 comments

Support string interpolation #277

tremby opened this issue Dec 10, 2015 · 7 comments


Copy link

tremby commented Dec 10, 2015

It doesn't look like string interpolation is supported.


Copy link

r3wt commented Dec 12, 2015

kind of a pointless feature don't you think? since any valid expression will already work inside of a double quoted string with the correct syntax ie {{}} or {%%}

Copy link

tremby commented Dec 12, 2015

No, I don't think so.

In case we're talking at cross purposes, the feature affects a double-quoted string which is already inside {{}} or {%%}. So instead of {{ "foo " ~ bar ~ " baz" }} you can do {{ "foo #{bar} baz" }}.

Copy link

plepe commented Dec 16, 2015

I'm not sure if it is easy to support. Maybe @connorhu can support it in his lexer branch?

Copy link

TheLarkInn commented May 31, 2017

One scenario I encountered was a situation like this:

{% extends "core::#{globals.twig.master}" %}

Copy link

Webslung commented Mar 7, 2018

Is this issue still in the pipeline? I have the same issue using a macro:

{{ svg.svg({class:"miz-comp-button_search--icon",title:"Search"},{href:"#{site.parent_theme}images/icons/miz-sprite.svg#action--search"}) }}

Just renders:

<svg class="miz-icon--sm miz-comp-button_search--icon" aria-hidden="true" focusable="false" title="Search">
  <use xlink:href="#{site.parent_theme}images/icons/miz-sprite.svg#action--search"></use>

Any solutions or just isn't supported?

Copy link

Grawl commented Sep 19, 2018

looks like it's not working for now


{% set foo = 'bar' %}
{{ "#{foo} baz" }}


#{foo} baz

Copy link

drzraf commented Dec 23, 2019

Really a must-have since this feature is heavily used in existing Twig template.
Twing's lexer supports it, may worth switching it (avoid NIH and combinate efforts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

9 participants