Comments (5)
Looking into this myself. Happens with textarea = "foo"
but not textarea foo
from slime.
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.
from slime.
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
Don't want to wrap my head around this now, so I think I'll leave it at that :)
from slime.
I don't completely understand why those newlines are being added. They're also added e.g. inside <title>
which seems weird. So the simplest fix would just be to not add those newlines anywhere, but I guess there's some reason they were introduced?
If the newlines should remain, I did figure out how to skip them for textareas only, though it's not super pretty: henrik@2de86b3
from slime.
Hey @henrik! I haven't had a chance to look into this yet but I suspect this PR is to blame for the newlines.
from slime.
Related Issues (20)
- Remove elixir 1.5 compiler warnings
- Add support for leading/trailing space control to dynamic_content HOT 3
- Explicit <% end %> (- end) tags HOT 2
- How do I define javascript type in this ? HOT 2
- New release? HOT 1
- Better compilation error message HOT 3
- Weird white spacing when using conditionals HOT 2
- Support Elixir 1.8 HOT 1
- Evaluating elixir module in custom embedded engine HOT 4
- Layout inheritance HOT 4
- Possible to support .leex templates? HOT 3
- Array values for attributes are not being properly parsed HOT 5
- What is the performance compared to Eex? HOT 3
- Getting an error when leaving a space between `doctype` and `html` HOT 4
- Support colon and special character for tailwind HOT 3
- Support for Phoenix 1.6 & HEEx HOT 14
- Add Tailwind JIT Support HOT 2
- Support sigils for inline heex with liveview HOT 2
- Unmaintained neotoma uses rebar2 HOT 9
- `cond` blocks in template problem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slime.