You've mentioned the succeed/precede/surround helpers about a million
times already... :) I'm just trying to come up with something shorter
and clearer. The above "solution" wouldn't have been very clear,
though, I admit.

http://henrik.nyh.se/2007/11/comma-after-link-in-haml is the best way
I can imagine this being done right now.

= link_to("Hmm", "#"), "?"

Of course + or << works too, instead of the comma, if you like that
better.

But it's only applicable in the case of a = line.


On Nov 8, 6:50 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> I really don't like the idea of trailing whitespace as a semantically
> significant marker. Not only is it invisible, but various editors and
> stuff like Google Groups eat it.
>
> Right now, the solution is to use the precede and succeed helpers. For
> example:
>
>   %div
>     = succeed '?' do
>       %a{ :href => '#' } Hmm
>
> Of course, this doesn't encompass all the issues. This is still
> something of an unsolved problem; the idea of a helper that does it has
> been floated around, though.
>
> - Nathan
>
> Frederick wrote:
> > Hypothetically, how would adjacent text nodes be handled? Could we do
> > it so that there's no whitespace between a text node and an inline
> > tag?
>
> > %div
> >   %a{ :href => "#" } Hmm
> >   ?
>
> > would render
>
> > <div>
> >   <a href="#">Hmm</a>?
> > </div>
>
> > But if you wanted a space between a text node and an inline tag, you
> > could add a space to the end (or the start, if the case is reversed)
> > of the text node?
>
> > %div
> >   Look at
> >   %a{ :href => "#" } this
> >   !
>
> > (Not sure if the space survived there, supposed to go after "Look
> > at".)
>
> > would render
>
> > <div>
> >   Look at <a href="#">this</a>!
> > </div>
>
> > Does that seem like a good solution?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to