diff --git a/lib/slim/splat/builder.rb b/lib/slim/splat/builder.rb index 84ecdc99..3d0b6afc 100644 --- a/lib/slim/splat/builder.rb +++ b/lib/slim/splat/builder.rb @@ -35,7 +35,7 @@ def attr(name, value) end if @attrs[name] if delim = @options[:merge_attrs][name] - @attrs[name] += delim + value.to_s + @attrs[name].concat(delim + value.to_s) else raise("Multiple #{name} attributes specified") end diff --git a/test/rails/app/views/slim/splat_with_delimiter.slim b/test/rails/app/views/slim/splat_with_delimiter.slim new file mode 100644 index 00000000..16775116 --- /dev/null +++ b/test/rails/app/views/slim/splat_with_delimiter.slim @@ -0,0 +1 @@ +.cute *{class: "nice"} Hello \ No newline at end of file diff --git a/test/rails/test/test_slim.rb b/test/rails/test/test_slim.rb index 2fbfb548..dacf0311 100644 --- a/test/rails/test/test_slim.rb +++ b/test/rails/test/test_slim.rb @@ -94,4 +94,9 @@ class TestSlim < ActionDispatch::IntegrationTest get "/slim/splat" assert_html "
Hello
" end + + test "splat with delimiter" do + get "/slim/splat_with_delimiter" + assert_html "
Hello
" + end end