Reputation: 150956
I have used
%span><=
and it can eat up the white space between this line and the next, and also outside of the span
tag, but it seems like an element needs to be used. The form
><=
or
<=
or
>=
can't be used to eat the space. Or is there some ways to make them work?
some docs at:
http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html#whitespace_removal__and_
Upvotes: 5
Views: 3265
Reputation: 24540
You can avoid HAML and write the span tag directly, here is an example:
%p
My paragraph text<span style="color:#5555FF">Span Text</span>
This way there won't be an empty character before the span text
Upvotes: 2
Reputation: 1892
Unfortunately, I believe the answer is "no." I've experimented with HAML quite a bit, trying to get it to do nice things with white space, but the > and < operators only work when placed directly after an element.
My (perhaps not so eloquent) way around this is to use :markdown
, :maruku
, or :textile
filters and write the problematic content as one line of markdown code. This ends up being easier to read, which, in my opinion, is at least half the point of HAML.
That's probably more simplistic an answer than you were hoping for, but HAML seems best for structure, and falls down a bit for content. I could reference http://chriseppstein.github.com/blog/2010/02/08/haml-sucks-for-content/ but you've probably already read it :-)
Cheers!
Upvotes: 1