-
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
Textarea adds blank lines #48
Comments
Looking into this myself. Happens with |
Failing test: test "does not add linebreaks to textarea with '=' output" do
slim = ~s"""
textarea = "foo"
"""
assert render(slim) == ~s(<textarea>foo</textarea>)
end Will see if I can figure out how to fix it, too, but I suspect that's trickier. |
This change will fix my test but break a bunch of others: --- a/lib/slim_fast/compiler.ex
+++ b/lib/slim_fast/compiler.ex
@@ -43,7 +43,7 @@ defmodule SlimFast.Compiler do
defp open(_, %{type: :eex, content: code, attributes: attrs}) do
inline = if attrs[:inline], do: "=", else: ""
- "<%#{inline} #{code} %>\n"
+ "<%#{inline} #{code} %>"
end
|
I don't completely understand why those newlines are being added. They're also added e.g. inside If the newlines should remain, I did figure out how to skip them for textareas only, though it's not super pretty: henrik@2de86b3 |
When I upgrade a project from slim_fast 0.7.0 to 0.9.1, the Slim code
that previously on 0.7.0 would output
now on 0.9.1 outputs
This leads to extra linebreaks in the received input, that were not intended.
The text was updated successfully, but these errors were encountered: