-
Notifications
You must be signed in to change notification settings - Fork 68
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
String interpolation in tags nested in variables does not work #55
Comments
@MajronMan it may be that I don't have much ☕️ in me yet but are these two examples not different? The first doesn't appear to include interpolation. Do you have code somewhere I can peek at? If not, I'll try to throw together a simple Slime application (sans Phoenix) and see if we can narrow it down. @Rakoth I think this may be an issue with the parser, wanted to give you a heads up 👍 |
@doomspork You might be right and it's not a perfect example, I just wanted to show that the case is certainly the interpolation since it's the only difference between those two pieces of code. I stumbled upon this bug in rather complex circumstances and I doubt they are worth describing in detail, but the main idea was to reuse a form created by my own function (to add CSRF token etc.) with inputs populated with values passed to the template by Phoenix View's assigns. Investigation enabled me to produce this simple example above. |
@MajronMan do you have that code public? |
@MajronMan Hi! Could you reproduce this issue with slime 1.0? |
@doomspork Unfortunately I can't share this code :( @Rakoth I don't know how to do it without using Phoenix Tag and I used this library, but I will try to do so tomorrow (I am in different timezone so it's evening for me) |
@MajronMan you could just add |
@Rakoth I created a repo with slime 1.0 and the bug is still there |
Thanks @MajronMan it helped a lot! I narrowed it down to a very strange behaviour of EEx: <h1>header</h1>
<% foo = "bar" %>
<% form_not_ok = Phoenix.HTML.Tag.content_tag(:form) do %>
test
<% a = "baz" %>
<div id="<%= a %>"></div>
<% end %>
<%= form_not_ok %> renders to test
<form>
test
<div id="baz"></div>
</form> Note repeated |
Environment:
Expected behaviour
String interpolation in input value works like without interpolation, e.g.
Renders
Actual behaviour
Renders
The text was updated successfully, but these errors were encountered: