diff --git a/lib/haml/precompiler.rb b/lib/haml/precompiler.rb index 9a6daa46..f5b28b14 100644 --- a/lib/haml/precompiler.rb +++ b/lib/haml/precompiler.rb @@ -668,7 +668,6 @@ END # Starts a filtered block. def start_filtered(name) raise HamlError.new("Invalid filter name \":#{name}\"") unless name =~ /^\w+$/ - raise SyntaxError.new('Filters must have nested text.') unless @block_opened unless filter = options[:filters][name] if filter == 'redcloth' || filter == 'markdown' || filter == 'textile' diff --git a/test/haml/engine_test.rb b/test/haml/engine_test.rb index 1ff03f89..b33fd985 100644 --- a/test/haml/engine_test.rb +++ b/test/haml/engine_test.rb @@ -5,7 +5,6 @@ class EngineTest < Test::Unit::TestCase EXCEPTION_MAP = { "!!!\n a" => "Illegal Nesting: Nesting within a header command is illegal.", "a\n b" => "Illegal Nesting: Nesting within plain text is illegal.", - ":a" => "Filters must have nested text.", "/ a\n b" => "Illegal Nesting: Nesting within a tag that already has content is illegal.", "% a" => 'Invalid tag: "% a"', "%p a\n b" => "Illegal Nesting: Content can't be both given on the same line as %p and nested within it.", @@ -439,6 +438,16 @@ class EngineTest < Test::Unit::TestCase end end + def test_empty_filter + assert_equal(< + // + +END + end + def test_local_assigns_dont_modify_class assert_equal("bar\n", render("= foo", :locals => {:foo => 'bar'})) assert_equal(nil, defined?(foo))