Class HtmlFilter
In: lib/facets/more/htmlfilter.rb
Parent: Object

Methods

filter   new  

Included Modules

Multiton

Constants

DEFAULT = { 'allowed' => { 'a' => ['href', 'target'], 'b' => [], 'i' => [], 'img' => ['src', 'width', 'height', 'alt']   default settings

Attributes

allow_numbered_entities  [RW]  entity control option (true, false)
allowed  [RW]  tags and attributes that are allowed

Eg.

  {
    'a' => ['href', 'target'],
    'b' => [],
    'img' => ['src', 'width', 'height', 'alt']
  }
allowed_entities  [RW]  entity control option (amp, gt, lt, quot, etc.)
allowed_protocols  [RW]  protocols which are allowed (http, ftp, mailto)
always_close  [RW]  tags which must always have seperate opening and closing tags (e.g. "")
always_make_tags  [RW]  should we try and make a b tag out of "b>" (true, false)
no_close  [RW]  tags which should always be self-closing (e.g. "<img />")
protocol_attributes  [RW]  attributes which should be checked for valid protocols (src,href)
remove_blanks  [RW]  tags which should be removed if they contain no content (e.g. "" or "<b />")
strip_comments  [RW]  should we remove comments? (true, false)
tag_counts  [R]  internal tag counter

Public Class methods

Public Instance methods

Filter html string.

[Validate]