Solstice::StripScripts - A subclass of HTML::StripScripts that contains our customized whitelists
use Solstice::StripScripts;
HTML::StripScripts
No symbols exported.
Returns a reference to the Context whitelist, which determines which tags may appear at each point in the document, and which other tags may be nested within them.
Context
It is a hash, and the keys are context names, such as Flow and Inline.
Flow
Inline
The values in the hash are hashrefs. The keys in these subhashes are lowercase tag names, and the values are context names, specifying the context that the tag provides to any other tags nested within it.
The special context EMPTY as a value in a subhash indicates that nothing can be nested within that tag.
EMPTY
Returns a reference to the Attrib whitelist, which determines which attributes each tag can have and the values that those attributes can take.
Attrib
It is a hash, and the keys are lowercase tag names.
The values in the hash are hashrefs. The keys in these subhashes are lowercase attribute names, and the values are attribute value class names, which are short strings describing the type of values that the attribute can take, such as color or number.
color
number
Returns a reference to the AttVal whitelist, which is a hash that maps attribute value class names from the Attrib whitelist to coderefs to subs to validate (and optionally transform) a particular attribute value.
AttVal
The filter calls the attribute value validation subs with the following parameters:
filter
A reference to the filter object.
tagname
The lowercase name of the tag in which the attribute appears.
attrname
The name of the attribute.
attrval
The attribute value found in the input document, in canonical form (see "CANONICAL FORM").
The validation sub can return undef to indicate that the attribute should be removed from the tag, or it can return the new value for the attribute, in canonical form.
Returns a reference to the Style whitelist, which determines which CSS style directives are permitted in style tag attributes. The keys are value names such as color and background-color, and the values are class names to be used as keys into the AttVal whitelist.
Style
style
background-color
Returns a reference to the Class whitelist, which determines which CSS class names are permitted in class tag attributes. The keys are the class names.
Class
class
Returns a reference to the DeInter whitelist, which determines which inline tags the filter should attempt to automatically de-interleave if they are encountered interleaved. For example, the filter will transform:
DeInter
<b>hello <i>world</b> !</i>
Into:
<b>hello <i>world</i></b><i> !</i>
because both b and i appear as keys in the DeInter whitelist.
b
i
References to the following subs appear in the AttVal whitelist returned by the init_attval_whitelist() method.
Attribute value hander for the style attribute.
Attribute value hander for the class attribute.
Attribute value handler for attributes who's values are some sort of size or length.
Attribute value handler for attributes who's values are a simple integer.
Attribute value handler for color attributes.
Attribute value handler for text attributes.
Attribute value handler for attributes who's values must consist of a single short word, with minus characters permitted.
Attribute value handler for attributes who's values must consist of one or more words, separated by spaces and/or commas.
Attribute value handler for attributes who's values must consist of one or more words, separated by commas, with optional doublequotes around words and spaces allowed within the doublequotes.
Attribute value handler for href type attributes. If the AllowHref configuration option is set, uses the validate_href_attribute() method to check the attribute value.
href
AllowHref
Attribute value handler for src type attributes. If the AllowSrc configuration option is set, uses the validate_src_attribute() method to check the attribute value.
src
AllowSrc
Attribute value handler for src type style pseudo attributes.
Attribute value handler for attributes that have no value or a value that is ignored. Just returns the attribute name as the value.
HTML::StripScripts.
Catalyst Group, <catalyst@u.washington.edu>
$Revision: 3387 $
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
To install Solstice, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Solstice
CPAN shell
perl -MCPAN -e shell install Solstice
For more information on module installation, please visit the detailed CPAN module installation guide.