lib/wunderbar/script.rb in wunderbar-1.4.5 vs lib/wunderbar/script.rb in wunderbar-1.5.0
- old
+ new
@@ -11,10 +11,12 @@
def serialize(options, result, indent)
@block ||= nil
if @block and @children.empty? and not @text
width = options[:width]
width -= indent.to_s.length if width
- @text = Ruby2JS.convert(@block, binding: @binding, width: width).to_s
+ opts = {binding: @binding, width: width}
+ opts = {**@attrs.delete(:options), **opts} if @attrs[:options]
+ @text = Ruby2JS.convert(@block, opts).to_s
end
super
end
end