diff --git a/lib/hamlit/new_attribute_compiler.rb b/lib/hamlit/new_attribute_compiler.rb index c96a6901..1679784c 100644 --- a/lib/hamlit/new_attribute_compiler.rb +++ b/lib/hamlit/new_attribute_compiler.rb @@ -42,8 +42,8 @@ module Hamlit token = tokens.first break unless token - pos = token.first.last - str = str[(pos - 1)..-1] + pos = token.first.last + str = str[pos..-1] end attributes diff --git a/spec/hamlit/engine/new_attribute_spec.rb b/spec/hamlit/engine/new_attribute_spec.rb index 24a93c3b..e7523b99 100644 --- a/spec/hamlit/engine/new_attribute_spec.rb +++ b/spec/hamlit/engine/new_attribute_spec.rb @@ -7,5 +7,13 @@ describe Hamlit::Engine do

bar

HTML end + + it 'renders multiple attributes' do + assert_render(<<-HAML, <<-HTML) + %p(a=1 b=2) bar + HAML +

bar

+ HTML + end end end