Sha256: 4a6ac152180c96f5ca32a77d6385b48c92904b77927a92aa1827ac11fd319118

Contents?: true

Size: 832 Bytes

Versions: 4

Compression:

Stored size: 832 Bytes

Contents

module HoboFields

  module SanitizeHtml

    PERMITTED_TAGS       = %w(a abbr acronym address b bdo big blockquote br caption center cite code colgroup dd del dfn dir
                              div dl dt em fieldset font h1 h2 h3 h4 h5 h6 i img ins kbd label legend li map menu ol optgroup
                              option p pre q s samp select small span strike strong sub sup table tbody td textarea tfoot
                              th thead tr tt u ul var)

    PERMITTED_ATTRIBUTES = %w(href title class style align name src label target border)

    class Helper; include ActionView::Helpers::SanitizeHelper; extend ActionView::Helpers::SanitizeHelper::ClassMethods; end
        
    def self.sanitize(s)
      Helper.new.sanitize(s, :tags => PERMITTED_TAGS, :attributes => PERMITTED_ATTRIBUTES)
    end

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hobofields-1.1.0 lib/hobo_fields/sanitize_html.rb
hobofields-1.1.0.pre4 lib/hobo_fields/sanitize_html.rb
hobofields-1.1.0.pre3 lib/hobo_fields/sanitize_html.rb
hobofields-1.1.0.pre2 lib/hobo_fields/sanitize_html.rb