API - XOOPS 2.5.11 Beta 2
By monxoops.fr
|
Public Member Functions | |
__construct () | |
parseText ($string, $config) | |
parseAttr ($string, $config) | |
parseData ($string, $is_attr, $config) | |
tokenizeHTML ($string, $config, $context) | |
normalize ($html, $config, $context) | |
extractBody ($html) | |
Static Public Member Functions | |
static | create ($config) |
Data Fields | |
$tracksLineNumbers = false | |
Static Protected Member Functions | |
static | escapeCDATA ($string) |
static | escapeCommentedCDATA ($string) |
static | removeIEConditional ($string) |
static | CDATACallback ($matches) |
Protected Attributes | |
$_special_entity2str | |
Forgivingly lexes HTML (SGML-style) markup into tokens.
A lexer parses a string of SGML-style markup and converts them into corresponding tokens. It doesn't check for well-formedness, although its internal mechanism may make this automatic (such as the case of HTMLPurifier_Lexer_DOMLex). There are several implementations to choose from.
A lexer is HTML-oriented: it might work with XML, but it's not recommended, as we adhere to a subset of the specification for optimization reasons. This might change in the future. Also, most tokenizers are not expected to handle DTDs or PIs.
This class should not be directly instantiated, but you may use create() to retrieve a default copy of the lexer. Being a supertype, this class does not actually define any implementation, but offers commonly used convenience functions for subclasses.
__construct | ( | ) |
Reimplemented in HTMLPurifier_Lexer_DOMLex.
|
staticprotected |
Callback function for escapeCDATA() that does the work.
array | $matches | PCRE matches array, with index 0 the entire match and 1 the inside of the CDATA section. |
|
static |
Retrieves or sets the default Lexer as a Prototype Factory.
By default HTMLPurifier_Lexer_DOMLex will be returned. There are a few exceptions involving special features that only DirectLex implements.
HTMLPurifier_Config | $config |
HTMLPurifier_Exception |
|
staticprotected |
Translates CDATA sections into regular sections (through escaping).
string | $string | HTML string to process. |
|
staticprotected |
Special CDATA case that is especially convoluted for <script>
string | $string | HTML string to process. |
extractBody | ( | $html | ) |
Takes a string of HTML (fragment or document) and returns the content
normalize | ( | $html, | |
$config, | |||
$context | |||
) |
Takes a piece of HTML and normalizes it by converting entities, fixing encoding, extracting bits, and other good stuff.
string | $html | HTML. |
HTMLPurifier_Config | $config | |
HTMLPurifier_Context | $context |
parseAttr | ( | $string, | |
$config | |||
) |
parseData | ( | $string, | |
$is_attr, | |||
$config | |||
) |
Parses special entities into the proper characters.
This string will translate escaped versions of the special characters into the correct ones.
string | $string | String character data to be parsed. |
parseText | ( | $string, | |
$config | |||
) |
|
staticprotected |
Special Internet Explorer conditional comments should be removed.
string | $string | HTML string to process. |
tokenizeHTML | ( | $string, | |
$config, | |||
$context | |||
) |
Lexes an HTML string into tokens.
$string | String HTML. | |
HTMLPurifier_Config | $config | |
HTMLPurifier_Context | $context |
Reimplemented in HTMLPurifier_Lexer_DirectLex, HTMLPurifier_Lexer_DOMLex, and HTMLPurifier_Lexer_PH5P.
|
protected |
Most common entity to raw value conversion table for special entities. @type array
$tracksLineNumbers = false |
Whether or not this lexer implements line-number/column-number tracking. If it does, set to true.