Sha256: a217379ac528437533d26baeb373627c6e69189b405b87928dd1c677875ee7e1
Contents?: true
Size: 500 Bytes
Versions: 11
Compression:
Stored size: 500 Bytes
Contents
module Cms class ContentFilter # Strips HTML from any attribute that's not :content # # Handles CKEditor's habit of adding opening/closing <p> tags to everything. # @TODO Have this inspect the underlying model to determine the actual attribute. def filter(content) c = content.clone c.keys.each do |key| if(key != :content && key != "content") c[key] = HTML::FullSanitizer.new.sanitize(c[key]).strip end end c end end end
Version data entries
11 entries across 11 versions & 2 rubygems