mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Haml] [html2haml] Handle <div class='foo.bar'> correctly.
This commit is contained in:
parent
54cf0e0371
commit
b02ae992c6
3 changed files with 8 additions and 1 deletions
|
@ -96,6 +96,9 @@ including the line number and the offending character.
|
|||
without spaces within the curly braces
|
||||
(e.g. `%p{:foo => "bar"}` as opposed to `%p{ :foo => "bar" }`).
|
||||
|
||||
* IDs and classes containing `#` and `.` are now output as string attributes
|
||||
(e.g. `%p{:class => "foo.bar"}`).
|
||||
|
||||
* Attributes are now sorted, to maintain a deterministic order.
|
||||
|
||||
## [2.2.7](http://github.com/nex3/haml/commit/2.2.7)
|
||||
|
|
|
@ -317,7 +317,7 @@ module Haml
|
|||
end
|
||||
|
||||
def static_attribute?(name, options)
|
||||
attributes[name] and !dynamic_attribute?(name, options)
|
||||
attributes[name] && attributes[name] =~ /^[-:\w]+$/ && !dynamic_attribute?(name, options)
|
||||
end
|
||||
|
||||
def dynamic_attribute?(name, options)
|
||||
|
|
|
@ -27,6 +27,10 @@ class Html2HamlTest < Test::Unit::TestCase
|
|||
render('<meta http-equiv="Content-Type" content="text/html" />'))
|
||||
end
|
||||
|
||||
def test_class_with_dot
|
||||
assert_equal('%div{:class => "foo.bar"}', render("<div class='foo.bar'></div>"))
|
||||
end
|
||||
|
||||
def test_interpolation
|
||||
assert_equal('Foo \#{bar} baz', render('Foo #{bar} baz'))
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue