1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actiontext/lib/action_text/attachments/minification.rb

18 lines
394 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module ActionText
2018-02-07 19:26:19 -05:00
module Attachments
module Minification
extend ActiveSupport::Concern
class_methods do
def fragment_by_minifying_attachments(content)
Fragment.wrap(content).replace(ActionText::Attachment.tag_name) do |node|
2018-02-08 12:01:46 -05:00
node.tap { |n| n.inner_html = "" }
2018-02-07 19:26:19 -05:00
end
end
end
end
end
end