mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Optimize string interpolation recursively
This commit is contained in:
parent
70acb89e10
commit
072bdda190
3 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/). This change log is
|
|||
### Added
|
||||
|
||||
- Optimize inline script inside a tag
|
||||
- Optimize string interpolation recursively
|
||||
|
||||
## [2.1.2](https://github.com/k0kubun/hamlit/compare/v2.1.1...v2.1.2) - 2015-12-16
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ module Hamlit
|
|||
when :static
|
||||
temple << [:static, content]
|
||||
when :dynamic
|
||||
temple << [:dynamic, content]
|
||||
temple << on_dynamic(content)
|
||||
end
|
||||
end
|
||||
temple
|
||||
|
|
|
@ -31,5 +31,10 @@ describe 'optimization' do
|
|||
haml = %q|%span= "jruby#{9000}#{dynamic}"|
|
||||
assert_equal true, compiled_code(haml).include?(%|<span>jruby9000|)
|
||||
end
|
||||
|
||||
it 'detects a static part recursively' do
|
||||
haml = %q|%input{ value: "#{ "hello#{ hello }" }" }|
|
||||
assert_equal true, compiled_code(haml).include?(%|value='hello|)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue