slime-lang / slime

Minimalistic HTML templates for Elixir, inspired by Slim.
http://slime-lang.com
MIT License
371 stars 57 forks source link

unescaped attributes #88

Closed vtsyganov closed 8 years ago

vtsyganov commented 8 years ago

Hi. Is there a way to avoid escaping of an attribute? Slim has '==' for that but looks like it doesn't work in Slime

lpil commented 8 years ago

Sorry, could you give an example?

vtsyganov commented 8 years ago

Sure. For example, I want to create a script tag with content window.userToken = 'some_token' How I should do that? Command: script == "window.userToken = '#{token}'" Result: <script>window.userToken = &#39;some_token&#39;</script>

doomspork commented 8 years ago

@vtsyganov what version are you using? This is what I get:

iex> slime = """
...> script == "window.userToken = '\#{token}'"
...> """
"script == \"window.userToken = '\#{token}'\"\n"
iex> Slime.render(slime, [token: "some_token"])
"<script>window.userToken = 'some_token'</script>"
Rakoth commented 8 years ago

I believe, the problem is with engine: Phoenix.HTML.Engine

doomspork commented 8 years ago

Sounds like this isn't a Slime issue so I'm going to close this. If this comes up again we can create an issue and take another look.