Something like:

haml_tag(:blockquote, :chomp_whitespace => :outside) do
  haml_tag(:p, :chomp_whitespace => :inside) do
    Foo
    Bar
  end
  haml_tag(:img, :chomp_whitespace => :all)
end

Would be cool, though, maybe a more concise way would be better... :)

On Jun 1, 6:25 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
> Yeah, that would be good. I'd also like some way to create self-closing
> tags. I'm not sure what the syntax would be, though... any suggestions?
>
> Rymaï wrote:
> > Hi,
>
> > Can we emulate '<' and '>' for #haml_tag method ?
>
> > Thanks,
>
> > Rémy.
>
> > On May 10, 11:18 pm, Nathan Weizenbaum <[EMAIL PROTECTED]> wrote:
>
> >> Hi folks,
>
> >> The single longest-standing and most egregious lack of functionality in
> >> Haml, as detailed 
> >> inhttp://nex-3.com/posts/75-haml-whitespace-handling-sucks-too, has
> >> finally been fixed. It's now possible to get Haml *not* to 
> >> insertwhitespaceeither around or within tags.
>
> >> The syntax for this is angle brackets, > or <, placed at the end of a
> >> tag (after the attributes but before = or / if you have them). You can
> >> think of them as alligators, chomping onwhitespace. > is chomping 
> >> thewhitespaceon the outside:
>
> >>   %blockquote
> >>     %p>
> >>       Foo
> >>       Bar
>
> >> =>
>
> >>   <blockquote><p>
> >>       Foo
> >>       Bar
> >>     </p></blockquote>
>
> >> And < is chomping thewhitespaceon the inside:
>
> >>   %blockquote
> >>     %p<
> >>       Foo
> >>       Bar
>
> >> =>
>
> >>   <blockquote>
> >>     <p>Foo
> >>     Bar</p>
> >>   </blockquote>
>
> >> These aren't the best examples, because they're not terribly useful. But
> >> you can also do stuff like
>
> >>   %img
> >>   %img>
> >>   %img
>
> >> =>
>
> >>   <img /><img /><img />
>
> >> Or
>
> >>   %pre<
> >>     :preserve
> >>       Foo
> >>        Bar
> >>         Baz
>
> >> =>
>
> >>   <pre>Foo&#x000A; Bar&#x000A;  Baz&#x000A;</pre>
>
> >> You can use this right now by getting Haml from
> >> git://github.com/nex3/haml.git and running "rake install" to install it
> >> as a gem.
>
> >> Many thanks to everyone who helped out with brainstorming how this
> >> feature should work, including Evgeny Zislis and Sunny Ripert on my
> >> blog, Nathan Sutton and Dustin Sallings on #haml on freenode, and many
> >> people in various conversations on this mailing list.
>
> >> - Nathan
--~--~---------~--~----~------------~-------~--~----~
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