Index: lib/haml/engine.rb
===================================================================
--- lib/haml/engine.rb  (revision 606)
+++ lib/haml/engine.rb  (working copy)
@@ -121,6 +121,7 @@
           'sass' => Sass::Engine,
           'plain' => Haml::Filters::Plain,
           'preserve' => Haml::Filters::Preserve,
+          'oneline' => Haml::Filters::OneLine,
           'redcloth' => Haml::Filters::RedCloth,
           'textile' => Haml::Filters::Textile,
           'markdown' => Haml::Filters::Markdown }
Index: lib/haml/filters.rb
===================================================================
--- lib/haml/filters.rb (revision 606)
+++ lib/haml/filters.rb (working copy)
@@ -49,7 +49,18 @@
         Haml::Helpers.preserve(@text)
       end
     end
+
+    class OneLine
+      def initialize(text)
+        @text = text
+      end

+      def render(scope = Object.new)
+        return Haml::Engine.new(@text).render(
+          scope).gsub(/^\s+/, "").gsub(/[\r\n]+/, "")
+      end
+    end
+
     class LazyLoaded
       def initialize(*reqs)
         reqs[0...-1].each do |req|


--~--~---------~--~----~------------~-------~--~----~
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