$tracksLineNumbers
$tracksLineNumbers :
Whether or not this lexer implements line-number/column-number tracking.
If it does, set to true.
Experimental HTML5-based parser using Jeroen van der Meer's PH5P library.
Occupies space in the HTML5 pseudo-namespace, which may cause conflicts.
tokenizeHTML(string $html, \HTMLPurifier_Config $config, \HTMLPurifier_Context $context) : array<mixed,\HTMLPurifier_Token>
Lexes an HTML string into tokens.
| string | $html | |
| \HTMLPurifier_Config | $config | |
| \HTMLPurifier_Context | $context |
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, $is_attr, $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. |
| $is_attr | ||
| $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, array<mixed,\HTMLPurifier_Token> $tokens, $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. |
| array<mixed,\HTMLPurifier_Token> | $tokens | Array-list of already tokenized tokens. |
| $config |
of node appended to previously passed tokens.
createStartNode(\DOMNode $node, array<mixed,\HTMLPurifier_Token> $tokens, boolean $collect, $config) : boolean
| \DOMNode | $node | DOMNode to be tokenized. |
| array<mixed,\HTMLPurifier_Token> | $tokens | Array-list of already tokenized tokens. |
| boolean | $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. |
| $config |
if the token needs an endtoken
createEndNode(\DOMNode $node, array<mixed,\HTMLPurifier_Token> $tokens)
| \DOMNode | $node | |
| array<mixed,\HTMLPurifier_Token> | $tokens |
wrapHTML(string $html, \HTMLPurifier_Config $config, \HTMLPurifier_Context $context, $use_div = true) : string
Wraps an HTML fragment in the necessary HTML
| string | $html | |
| \HTMLPurifier_Config | $config | |
| \HTMLPurifier_Context | $context | |
| $use_div |