mirror of
https://github.com/zhigang1992/sass.git
synced 2026-04-29 01:35:35 +08:00
Merge branch 'stable'
This commit is contained in:
@@ -22,6 +22,9 @@ that causes attributes to use a double-quote mark rather than single-quote.
|
||||
* Got rid of trailing whitespace produced when opening a conditional comment
|
||||
(thanks to [Norman Clarke](http://blog.njclarke.com/)).
|
||||
|
||||
* Fixed CSS id concatenation when a numeric id is given as an attribute.
|
||||
(thanks to [Norman Clarke](http://blog.njclarke.com/)).
|
||||
|
||||
## [2.2.4](http://github.com/nex3/haml/commit/2.2.4)
|
||||
|
||||
* Allow `end` to be used for silent script when it's followed by code.
|
||||
|
||||
@@ -245,7 +245,7 @@ RUBY
|
||||
# @return [Hash<String, String>] `to`, after being merged
|
||||
def self.merge_attrs(to, from)
|
||||
if to['id'] && from['id']
|
||||
to['id'] << '_' << from.delete('id')
|
||||
to['id'] << '_' << from.delete('id').to_s
|
||||
elsif to['id'] || from['id']
|
||||
from['id'] ||= to['id']
|
||||
end
|
||||
|
||||
@@ -112,6 +112,11 @@ class EngineTest < Test::Unit::TestCase
|
||||
assert_equal("<div class='atlantis' style='ugly'></div>", render(".atlantis{:style => 'ugly'}").chomp)
|
||||
end
|
||||
|
||||
def test_css_id_as_attribute_should_be_appended_with_underscore
|
||||
assert_equal("<div id='my_id_1'></div>", render("#my_id{:id => '1'}").chomp)
|
||||
assert_equal("<div id='my_id_1'></div>", render("#my_id{:id => 1}").chomp)
|
||||
end
|
||||
|
||||
def test_ruby_code_should_work_inside_attributes
|
||||
author = 'hcatlin'
|
||||
assert_equal("<p class='3'>foo</p>", render("%p{:class => 1+2} foo").chomp)
|
||||
|
||||
Reference in New Issue
Block a user