$tracksLineNumbers
$tracksLineNumbers
Whether or not this lexer implements line-number/column-number tracking.
If it does, set to true.
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.
create(\HTMLPurifier_Config $config) : \HTMLPurifier_Lexer
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 |
parseData(string $string, mixed $is_attr, mixed $config) : string
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. |
mixed | $is_attr | |
mixed | $config |
Parsed character data.
tokenizeHTML( $string, \HTMLPurifier_Config $config, \HTMLPurifier_Context $context) : \HTMLPurifier_Token[]
Lexes an HTML string into tokens.
$string | String HTML. |
|
\HTMLPurifier_Config | $config | |
\HTMLPurifier_Context | $context |
array representation of HTML.
normalize(string $html, \HTMLPurifier_Config $config, \HTMLPurifier_Context $context) : string
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 |