diff --git a/lib/haml/helpers/action_view_extensions.rb b/lib/haml/helpers/action_view_extensions.rb index 845546c2..35e346df 100644 --- a/lib/haml/helpers/action_view_extensions.rb +++ b/lib/haml/helpers/action_view_extensions.rb @@ -45,8 +45,8 @@ module Haml # @yield A block in which all input to `#haml_concat` is treated as raw. # @see Haml::Util#rails_xss_safe? def with_raw_haml_concat + old = instance_variable_defined?('@_haml_concat_raw') ? @_haml_concat_raw : false @_haml_concat_raw = true - old = @_haml_concat_raw yield ensure @_haml_concat_raw = old diff --git a/test/helper_test.rb b/test/helper_test.rb index c9040f46..97543220 100644 --- a/test/helper_test.rb +++ b/test/helper_test.rb @@ -14,6 +14,16 @@ module Haml::Helpers def something_that_uses_haml_concat haml_concat('foo').to_s end + + def render_something_with_haml_concat + haml_concat "
"
+ end
+
+ def render_something_with_haml_tag_and_concat
+ haml_tag 'p' do
+ haml_concat ' \n