Hi folks,

The single longest-standing and most egregious lack of functionality in 
Haml, as detailed in 
http://nex-3.com/posts/75-haml-whitespace-handling-sucks-too, has 
finally been fixed. It's now possible to get Haml *not* to insert 
whitespace either 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 on whitespace. > is chomping the 
whitespace on the outside:

  %blockquote
    %p>
      Foo
      Bar

=>

  <blockquote><p>
      Foo
      Bar
    </p></blockquote>

And < is chomping the whitespace on 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