Skip to content

Commit

Permalink
Merge branch 'stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Jan 7, 2010
2 parents 5a07344 + 207b962 commit 314e7eb
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions doc-src/HAML_CHANGELOG.md
Expand Up @@ -153,6 +153,9 @@ that surrounds the filtered text with `<style>` and CDATA tags.

* Fix compilation of HTML5 doctypes when using `html2haml`.

* `nil` values for Sass options are now ignored,
rather than raising errors.

## [2.2.16](http://github.com/nex3/haml/commit/2.2.16)

* Abstract out references to `ActionView::TemplateError`,
Expand Down
3 changes: 3 additions & 0 deletions doc-src/SASS_CHANGELOG.md
Expand Up @@ -116,6 +116,9 @@ Several bug fixes and minor improvements have been made, including:

* Report the filename in warnings about selectors without properties.

* `nil` values for Sass options are now ignored,
rather than raising errors.

### Must Read!

* When `@import` is given a filename without an extension,
Expand Down
2 changes: 1 addition & 1 deletion lib/haml/engine.rb
Expand Up @@ -88,7 +88,7 @@ def initialize(template, options = {})
unless ruby1_8?
@options[:encoding] = Encoding.default_internal || "utf-8"
end
@options.merge! options
@options.merge! options.reject {|k, v| v.nil?}
@index = 0

unless [:xhtml, :html4, :html5].include?(@options[:format])
Expand Down
2 changes: 1 addition & 1 deletion lib/sass/engine.rb
Expand Up @@ -130,7 +130,7 @@ def comment?
# @param options [{Symbol => Object}] An options hash;
# see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}
def initialize(template, options={})
@options = DEFAULT_OPTIONS.merge(options)
@options = DEFAULT_OPTIONS.merge(options.reject {|k, v| v.nil?})
@template = template

# Backwards compatibility
Expand Down
4 changes: 4 additions & 0 deletions test/haml/engine_test.rb
Expand Up @@ -283,6 +283,10 @@ def test_both_whitespace_nukes_work_together
SOURCE
end

def test_nil_option
assert_equal("<p foo='bar'></p>\n", render('%p{:foo => "bar"}', :attr_wrapper => nil))
end

# Regression tests

def test_whitespace_nuke_with_both_newlines
Expand Down
10 changes: 10 additions & 0 deletions test/sass/engine_test.rb
Expand Up @@ -1019,6 +1019,16 @@ def test_pseudo_class_with_new_properties
SASS
end

def test_nil_option
assert_equal(<<CSS, render(<<SASS, :format => nil))
foo {
a: b; }
CSS
foo
a: b
SASS
end

# Regression tests

def test_parens_in_mixins
Expand Down

0 comments on commit 314e7eb

Please sign in to comment.