Here's the reproduction
puts Haml::Engine.new(%{%a(data-foo="#{render 'foobar',foo: bar}")}).precompiled.gsub(';', "\n")
the following has been re-indented for readability, notice that the second line produces invalid code ("#{render 'foobar')
_hamlout.buffer << ("<a".freeze)
_haml_attribute_compiler1 = ("#{render 'foobar')
case (_haml_attribute_compiler1)
when Hash
_hamlout.buffer << ((_hamlout.attributes({ "data-foo".freeze => _haml_attribute_compiler1 }, nil)).to_s)
when true
_hamlout.buffer << (" data-foo".freeze)
when false, nil
else
_hamlout.buffer << (" data-foo='".freeze)
_hamlout.buffer << (::Haml::Helpers.html_escape((_haml_attribute_compiler1)))
_hamlout.buffer << ("'".freeze)
end
_haml_attribute_compiler2 = (bar}")
case (_haml_attribute_compiler2)
when Hash
_hamlout.buffer << ((_hamlout.attributes({ "foo".freeze => _haml_attribute_compiler2 }, nil)).to_s)
when true
_hamlout.buffer << (" foo".freeze)
when false, nil
else
_hamlout.buffer << (" foo='".freeze)
_hamlout.buffer << (::Haml::Helpers.html_escape((_haml_attribute_compiler2)))
_hamlout.buffer << ("'".freeze)
end
_hamlout.buffer << ("></a>\n".freeze)
Here's the reproduction
puts Haml::Engine.new(%{%a(data-foo="#{render 'foobar',foo: bar}")}).precompiled.gsub(';', "\n")the following has been re-indented for readability, notice that the second line produces invalid code
("#{render 'foobar')