-
Notifications
You must be signed in to change notification settings - Fork 57
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
Code-as-attributes doesn't work, e.g. src=static_path(@conn, "x.css") #32
Comments
Thanks @henrik, this looks like a bug. |
Glad to see this library is alive and well and being maintained :) Thanks so much for all the hard work! Sent from my iPhone
|
You're welcome! Myself or @Rakoth will take a look at these bugs. Thanks again for taking the time to file them. 👍 |
Hi @henrik, we have some problems with elixir code with spaces as attribute values. link rel="stylesheet" href=static_path(@conn,"/css/app.css") should work for you now |
This one is going to take some regex magic to sort out. The offending regex at parser.ex#L25, specifically this part: |
@Rakoth Thanks for the workaround! Regarding the regex, I believe checking for balanced parentheses (if we want to allow If all else fails, I guess |
This seems applicable: http://www.erlang.org/doc/man/re.html#sect20 No time to dig further into it now I'm afraid, but maybe later if you don't beat me to it (feel free). |
Experimenting with the linked regexp, I get this:
With output:
So it handles nested parentheses but parentheses inside a string can mess it up. Handling those (and maybe accounting for escaped quotes inside strings…) could get hairy. I'm thinking if this should be handled perfectly, a regexp probably isn't the way to go. |
@doomspork Is there any progress on this issue? |
@dannote I don't believe anyone has worked on this since there is a reasonable work-around, though it would be nice to resolve. |
Any attribute that had an Elixir expression with a space in it would not be parsed correctly. This commit should mitigate most instances. Fixes slime-lang#32
Any attribute that had an Elixir expression with a space in it would not be parsed correctly. This commit should mitigate most instances. Fixes #32
This gives a "missing terminator" error:
This works, though:
The equivalent of the first example works in the Ruby version of Slim.
Maybe it could make sense to include a valid example of a dynamic attribute value in the README docs?
The text was updated successfully, but these errors were encountered: