lib/streamlined/helpers.rb in streamlined-0.5.0 vs lib/streamlined/helpers.rb in streamlined-0.5.1
- old
+ new
@@ -87,10 +87,14 @@
str.encode(xml: :attr).gsub(%r{\A"|"\Z}, "")
end
end
def html(callback, piping = nil)
- callback = Serbea::Pipeline.new(binding, callback).tap { _1.instance_exec(&piping) } if piping
+ if piping
+ callback = Serbea::Pipeline.new(binding, callback).tap { _1.instance_exec(&piping) }.then do |pipeline|
+ -> { pipeline.value }
+ end
+ end
callback.html_safe.touch
end
def html_map(input, &callback)