Sha256: 42f6f426f4acc16356e884aa8306fdd88ea6a24b3d7ee9e5c46364171f2bf60e
Contents?: true
Size: 402 Bytes
Versions: 6
Compression:
Stored size: 402 Bytes
Contents
require 'sanitize' class Govspeak::HtmlSanitizer def initialize(dirty_html) @dirty_html = dirty_html end def sanitize Sanitize.clean(@dirty_html, sanitize_config) end def sanitize_config config = Sanitize::Config::RELAXED.dup config[:attributes][:all].push("id", "class") config[:attributes]["a"].push("rel") config[:elements].push("div", "hr") config end end
Version data entries
6 entries across 6 versions & 1 rubygems