Sha256: 0727989be08c512dd12f923a4a2bf7ae7da7b014912504be79b30d6a826e15e9

Contents?: true

Size: 818 Bytes

Versions: 20

Compression:

Stored size: 818 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 tbody td textarea tfoot
                              th thead tr tt u ul var)

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

    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

20 entries across 20 versions & 1 rubygems

Version Path
hobofields-1.0.3 lib/hobo_fields/sanitize_html.rb
hobofields-1.1.0.pre0 lib/hobo_fields/sanitize_html.rb
hobofields-1.0.2 lib/hobo_fields/sanitize_html.rb
hobofields-1.0.1 lib/hobo_fields/sanitize_html.rb
hobofields-1.0.0 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.106 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.105 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.104 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.103 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.102 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.101 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.100 lib/hobo_fields/sanitize_html.rb
hobofields-0.9.0 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.10 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.9 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.8 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.7 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.6 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.4 lib/hobo_fields/sanitize_html.rb
hobofields-0.8.5 lib/hobo_fields/sanitize_html.rb