Sha256: f30becfaffd409ca07b59d6ceae5dbde9a8c749e7e040cd83c5d0adb60f66475

Contents?: true

Size: 1.71 KB

Versions: 3

Compression:

Stored size: 1.71 KB

Contents

class Sanitize
  module Config

    CUSTOM = {
      :elements => %w[
      a abbr b blockquote br caption cite code col colgroup dd del div dl
      dt nav em figcaption figure font form h1 h2 h3 h4 h5 h6 hgroup hr i img input ins li label link
      ol p pre s small span strike strong style sub sup table tbody td
      tfoot th thead time tr u ul iframe
      ],

      :attributes => {
        :all => ['dir', 'lang', 'title', 'class', 'style', 'id', 'draggable', 'contenteditable'],
        'a' => ['href', 'target'],
        'blockquote' => ['cite'],
        'col' => ['span', 'width'],
        'colgroup' => ['span', 'width'],
        'del' => ['cite', 'datetime'],
        'img' => ['align', 'alt', 'height', 'src', 'width'],
        'ins' => ['cite', 'datetime'],
        'input' => ['name','placeholder', 'type', 'value', 'width'],
        'form' => ['action', 'method', 'name'],
        'link' => ['href', 'rel', 'type'],
        'ol' => ['start', 'reversed', 'type'],
        'q' => ['cite'],
        'table' => ['summary', 'width'],
        'td' => ['abbr', 'axis', 'colspan', 'rowspan', 'width'],
        'th' => ['abbr', 'axis', 'colspan', 'rowspan', 'scope', 'width'],
        'time' => ['datetime', 'pubdate'],
        'ul' => ['type'],
        'iframe' => ['width', 'height', 'src', 'allowFullScreen', 'allowfullscreen', 'frameborder'],
      },

      :protocols => {
        'a' => {'href' => ['ftp', 'http', 'https', 'mailto', :relative]},
        'img' => {'src' => ['http', 'https', :relative]},
        'ins' => {'cite' => ['http', 'https', :relative]},
        'q' => {'cite' => ['http', 'https', :relative]}
      },

      :add_attributes => {},

      :css => {
        :properties => %w[width height]
      }
    }

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
convert-0.1.7 lib/sanitizers/custom.rb
convert-0.1.6 lib/sanitizers/custom.rb
convert-0.1.5 lib/sanitizers/custom.rb