quote_content.rb 569 B

123456789101112131415161718192021222324
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class HtmlSanitizer
  3. module Scrubber
  4. class QuoteContent < Base
  5. def scrub(node)
  6. return if tags_quote_content.exclude?(node.name)
  7. string = html_decode(node.content)
  8. text = Nokogiri::XML::Text.new(string, node.document)
  9. node.add_next_sibling(text)
  10. node.remove
  11. STOP
  12. end
  13. private
  14. def tags_quote_content
  15. @tags_quote_content ||= Rails.configuration.html_sanitizer_tags_quote_content
  16. end
  17. end
  18. end
  19. end