Module | Sanitize::Config |
In: |
lib/sanitize/config/restricted.rb
lib/sanitize/config/basic.rb lib/sanitize/config/relaxed.rb lib/sanitize/config.rb |
RESTRICTED | = | { :elements => %w[b em i strong u] |
BASIC | = | { :elements => %w[ a abbr b blockquote br cite code dd dfn dl dt em i kbd li mark ol p pre q s samp small strike strong sub sup time u ul var ], :attributes => { 'a' => ['href'], 'abbr' => ['title'], 'blockquote' => ['cite'], 'dfn' => ['title'], 'q' => ['cite'], 'time' => ['datetime', 'pubdate'] |
RELAXED | = | { :elements => %w[ a abbr b bdo blockquote br caption cite code col colgroup dd del dfn dl dt em figcaption figure h1 h2 h3 h4 h5 h6 hgroup i img ins kbd li mark ol p pre q rp rt ruby s samp small strike strong sub sup table tbody td tfoot th thead time tr u ul var wbr ], :attributes => { :all => ['dir', 'lang', 'title'], 'a' => ['href'], 'blockquote' => ['cite'], 'col' => ['span', 'width'], 'colgroup' => ['span', 'width'], 'del' => ['cite', 'datetime'], 'img' => ['align', 'alt', 'height', 'src', 'width'], 'ins' => ['cite', 'datetime'], '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'] |
DEFAULT | = | { # Whether or not to allow HTML comments. Allowing comments is strongly # discouraged, since IE allows script execution within conditional # comments. :allow_comments => false, # HTML attributes to add to specific elements. By default, no attributes # are added. :add_attributes => {}, # HTML attributes to allow in specific elements. By default, no attributes # are allowed. :attributes => {}, # HTML elements to allow. By default, no elements are allowed (which means # that all HTML will be stripped). :elements => [], # Output format. Supported formats are :html and :xhtml. Default is :html. :output => :html, # Character encoding to use for HTML output. Default is 'utf-8'. :output_encoding => 'utf-8', # URL handling protocols to allow in specific attributes. By default, no # protocols are allowed. Use :relative in place of a protocol if you want # to allow relative URLs sans protocol. :protocols => {}, # If this is true, Sanitize will remove the contents of any filtered # elements in addition to the elements themselves. By default, Sanitize # leaves the safe parts of an element's contents behind when the element # is removed. # # If this is an Array of element names, then only the contents of the # specified elements (when filtered) will be removed, and the contents of # all other filtered elements will be left behind. :remove_contents => false, # Transformers allow you to filter or alter nodes using custom logic. See # README.rdoc for details and examples. :transformers => [], # By default, transformers perform depth-first traversal (deepest node # upward). This setting allows you to specify transformers that should # perform breadth-first traversal (top node downward). :transformers_breadth => [], # Elements which, when removed, should have their contents surrounded by # space characters to preserve readability. For example, # `foo<div>bar</div>baz` will become 'foo bar baz' when the <div> is # removed. :whitespace_elements => %w[ address article aside blockquote br dd div dl dt footer h1 h2 h3 h4 h5 h6 header hgroup hr li nav ol p pre section ul ] |