lib/streamlined/helpers.rb in streamlined-0.2.0 vs lib/streamlined/helpers.rb in streamlined-0.3.0
- old
+ new
@@ -79,10 +79,10 @@
def attribute_segment(attr, value)
"#{attr}=#{value.to_s.encode(xml: :attr)}"
end
def text(callback)
- (callback.is_a?(Proc) ? html(callback) : callback).to_s.then do |str|
+ (callback.is_a?(Proc) ? callback.pipe : callback).to_s.then do |str|
next str if str.html_safe?
str.encode(xml: :attr).gsub(%r{\A"|"\Z}, "")
end
end