README.rdoc in adamh-sanitize-1.0.4.4 vs README.rdoc in adamh-sanitize-1.1.0
- old
+ new
@@ -7,26 +7,25 @@
Using a simple configuration syntax, you can tell Sanitize to allow certain
elements, certain attributes within those elements, and even certain URL
protocols within attributes that contain URLs. Any HTML elements or attributes
that you don't explicitly allow will be removed.
-Because it's based on Hpricot, a full-fledged HTML parser, rather than a bunch
+Because it's based on nokogiri, a full-fledged HTML parser, rather than a bunch
of fragile regular expressions, Sanitize has no trouble dealing with malformed
or maliciously-formed HTML. When in doubt, Sanitize always errs on the side of
caution.
*Author*:: Ryan Grove (mailto:ryan@wonko.com)
-*Version*:: 1.0.4 (2009-01-16)
+*Version*:: 1.0.8 (2009-04-23)
*Copyright*:: Copyright (c) 2009 Ryan Grove. All rights reserved.
*License*:: MIT License (http://opensource.org/licenses/mit-license.php)
*Website*:: http://github.com/rgrove/sanitize
== Requires
* RubyGems
-* Hpricot 0.6+
-* HTMLEntities 4.0.0+
+* nokogiri
== Usage
If you don't specify any configuration options, Sanitize will use its strictest
settings by default, which means it will strip all HTML.
@@ -98,10 +97,18 @@
'a' => ['href', 'title'],
'blockquote' => ['cite'],
'img' => ['alt', 'src', 'title']
}
+If you'd like to allow certain attributes on all elements, use the symbol
+<code>:all</code> instead of an element name.
+
+ :attributes => {
+ :all => ['class'],
+ 'a' => ['href', 'title']
+ }
+
==== :add_attributes
Attributes to add to specific elements. If the attribute already exists, it will
be replaced with the value specified here. Specify all element names and
attributes in lowercase.
@@ -120,14 +127,27 @@
'a' => {'href' => ['ftp', 'http', 'https', 'mailto']},
'img' => {'src' => ['http', 'https']}
}
If you'd like to allow the use of relative URLs which don't have a protocol,
-include the special value <code>:relative</code> in the protocol array:
+include the symbol <code>:relative</code> in the protocol array:
:protocols => {
'a' => {'href' => ['http', 'https', :relative]}
}
+
+
+== Contributors
+
+The following lovely people have contributed to Sanitize in the form of patches
+or ideas that later became code:
+
+* Peter Cooper <git@peterc.org>
+* Ryan Grove <ryan@wonko.com>
+* Adam Hooper <adam@adamhooper.com>
+* Mutwin Kraus <mutle@blogage.de>
+* Dev Purkayastha <dev.purkayastha@gmail.com>
+* Ben Wanicur <bwanicur@verticalresponse.com>
== License
Copyright (c) 2009 Ryan Grove <ryan@wonko.com>