From 14be5ca21a4f1c1a682376a97b811b33df105fe1 Mon Sep 17 00:00:00 2001 From: Robert Straw Date: Thu, 13 May 2021 18:02:40 -0500 Subject: [PATCH] rendered fragments should return a string The current implementation of #to_s actually returns an array. (The array[idx,n] syntax, even if n=1, returns Array.) It goes without saying that most asset helpers in the padrino framework expect that to_s returns a string, and wrapping brackets around stuff is not good. --- lib/markaby/builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/markaby/builder.rb b/lib/markaby/builder.rb index 88bac40..738a80d 100644 --- a/lib/markaby/builder.rb +++ b/lib/markaby/builder.rb @@ -315,7 +315,7 @@ module Markaby # We can't do @stream.slice!(@start, @length), # as it would invalidate the @starts and @lengths of other Fragment instances. - @str = @stream[@start, @length].to_s.html_safe + @str = @stream[@start, @length].join(" ").to_s.html_safe @stream[@start, @length] = [nil] * @length end -- 2.45.2