replace_inline_images.rb 377 B

123456789101112131415
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class HtmlSanitizer
  3. class ReplaceInlineImages
  4. def sanitize(string, prefix)
  5. scrubber = HtmlSanitizer::Scrubber::InlineImages.new(prefix)
  6. sanitized = Loofah
  7. .fragment(string)
  8. .scrub!(scrubber)
  9. [sanitized.to_html, scrubber.attachments_inline]
  10. end
  11. end
  12. end