Module: Sanitize::Config

Defined in:
lib/sanitize/config/generous.rb

Constant Summary collapse

GENEROUS =
{
  :elements => %w[
    a b blockquote br caption cite code dd del dl dt em h1 h2 h3 h4 h5 h6 i img li ol p pre small span strike strong sub sup table tbody td th thead tr u ul
  ],

  :attributes => {
    :all         => ['dir', 'lang', 'title', 'class'],
    'a'          => ['href'],
    'blockquote' => ['cite'],
    'img'        => ['align', 'alt', 'height', 'src', 'width'],
    'ol'         => ['start', 'reversed', 'type'],
    'ul'         => ['type'],
    'th'         => ['colspan', 'rowspan'],
    'td'         => ['colspan', 'rowspan']
  },

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