Support string interpolation #277

Open
tremby opened this Issue Dec 10, 2015 · 5 comments

Comments

Projects
None yet
6 participants
@tremby

tremby commented Dec 10, 2015

It doesn't look like string interpolation is supported.

See http://twig.sensiolabs.org/doc/templates.html#string-interpolation

@r3wt

This comment has been minimized.

Show comment
Hide comment
@r3wt

r3wt 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 {%%}

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 {%%}

@tremby

This comment has been minimized.

Show comment
Hide comment
@tremby

tremby 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" }}.

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" }}.

@plepe

This comment has been minimized.

Show comment
Hide comment
@plepe

plepe Dec 16, 2015

Collaborator

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

Collaborator

plepe commented Dec 16, 2015

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

@TheLarkInn

This comment has been minimized.

Show comment
Hide comment
@TheLarkInn

TheLarkInn May 31, 2017

One scenario I encountered was a situation like this:

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

One scenario I encountered was a situation like this:

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

@Webslung

This comment has been minimized.

Show comment
Hide comment
@Webslung

Webslung 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>
</svg>

Any solutions or just isn't supported?

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>
</svg>

Any solutions or just isn't supported?

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