Class HTMLPurifier_Lexer_DirectLex
Inheritance | HTMLPurifier_Lexer_DirectLex » HTMLPurifier_Lexer |
---|
Our in-house implementation of a parser.
A pure PHP parser, DirectLex has absolutely no dependencies, making it a reasonably good default for PHP4. Written with efficiency in mind, it can be four times faster than HTMLPurifier_Lexer_PEARSax3, although it pales in comparison to HTMLPurifier_Lexer_DOMLex.
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$tracksLineNumbers | HTMLPurifier_Lexer_DirectLex |
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_special_entity2str | Most common entity to raw value conversion table for special entities. | HTMLPurifier_Lexer | |
$_whitespace | Whitespace characters for str(c)spn. | HTMLPurifier_Lexer_DirectLex |
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | HTMLPurifier_Lexer | |
create() | Retrieves or sets the default Lexer as a Prototype Factory. | HTMLPurifier_Lexer |
extractBody() | Takes a string of HTML (fragment or document) and returns the content | HTMLPurifier_Lexer |
normalize() | Takes a piece of HTML and normalizes it by converting entities, fixing encoding, extracting bits, and other good stuff. | HTMLPurifier_Lexer |
parseAttributeString() | Takes the inside of an HTML tag and makes an assoc array of attributes. | HTMLPurifier_Lexer_DirectLex |
parseData() | Parses special entities into the proper characters. | HTMLPurifier_Lexer |
tokenizeHTML() | HTMLPurifier_Lexer_DirectLex |
Protected Methods
Method | Description | Defined By |
---|---|---|
CDATACallback() | Callback function for escapeCDATA() that does the work. | HTMLPurifier_Lexer |
escapeCDATA() | Translates CDATA sections into regular sections (through escaping). | HTMLPurifier_Lexer |
escapeCommentedCDATA() | Special CDATA case that is especially convoluted for | HTMLPurifier_Lexer |
removeIEConditional() | Special Internet Explorer conditional comments should be removed. | HTMLPurifier_Lexer |
scriptCallback() | Callback function for script CDATA fudge | HTMLPurifier_Lexer_DirectLex |
substrCount() | PHP 5.0.x compatible substr_count that implements offset and length | HTMLPurifier_Lexer_DirectLex |
Property Details
Method Details
Takes the inside of an HTML tag and makes an assoc array of attributes.
public array parseAttributeString ( $string, $config, $context ) | ||
$string | string | Inside of tag excluding name. |
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context | |
return | array | Assoc array of attributes. |
---|
Callback function for script CDATA fudge
protected string scriptCallback ( $matches ) | ||
$matches |
PHP 5.0.x compatible substr_count that implements offset and length
protected int substrCount ( $haystack, $needle, $offset, $length ) | ||
$haystack | string | |
$needle | string | |
$offset | int | |
$length | int |
public array|HTMLPurifier_Token[] tokenizeHTML ( $html, $config, $context ) | ||
$html | String | |
$config | HTMLPurifier_Config | |
$context | HTMLPurifier_Context |