提交 0dd24045 编写于 作者: R Ryuta Kamizono

Merge pull request #37494 from shugo/safe_buffer_enumerator_fix

Enumerator should be supported by ActiveSupport::SafeBuffer
上级 8297f8a3
......@@ -298,6 +298,8 @@ def html_escape_interpolated_argument(arg)
def set_block_back_references(block, match_data)
block.binding.eval("proc { |m| $~ = m }").call(match_data)
rescue ArgumentError
# Can't create binding from C level Proc
end
end
end
......
......@@ -274,4 +274,9 @@ def test_titleize
assert_equal "123foo 456bar", b
assert_not_predicate b, :html_safe?
end
test "Should support Enumerator" do
a = "aaa".html_safe.gsub!(/a/).with_index { |m, i| i }
assert_equal "012", a
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册