$tracksLineNumbers
$tracksLineNumbers
Whether or not this lexer implements line-number/column-number tracking.
If it does, set to true.
Parser that uses PHP 5's DOM extension (part of the core).
In PHP 5, the DOM XML extension was revamped into DOM and added to the core. It gives us a forgiving HTML parser, which we use to transform the HTML into a DOM, and then into the tokens. It is blazingly fast (for large documents, it performs twenty times faster than HTMLPurifier_Lexer_DirectLex,and is the default choice for PHP 5.
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.
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 |
tokenizeDOM(\DOMNode $node, \HTMLPurifier_Token[] $tokens, mixed $config) : \HTMLPurifier_Token
Iterative function that tokenizes a node, putting it into an accumulator.
To iterate is human, to recurse divine - L. Peter Deutsch
\DOMNode | $node | DOMNode to be tokenized. |
\HTMLPurifier_Token[] | $tokens | Array-list of already tokenized tokens. |
mixed | $config |
of node appended to previously passed tokens.
createStartNode(\DOMNode $node, \HTMLPurifier_Token[] $tokens, bool $collect, mixed $config) : bool
\DOMNode | $node | DOMNode to be tokenized. |
\HTMLPurifier_Token[] | $tokens | Array-list of already tokenized tokens. |
bool | $collect | Says whether or start and close are collected, set to false at first recursion because it's the implicit DIV tag you're dealing with. |
mixed | $config |
if the token needs an endtoken