|
| | callbackArmorCommentEntities ($matches) |
| | Callback function that entity-izes ampersands in comments so that callbackUndoCommentSubst doesn't clobber them.
|
| |
| | callbackUndoCommentSubst ($matches) |
| | Callback function for undoing escaping of stray angled brackets in comments.
|
| |
| | extractBody ($html) |
| | Takes a string of HTML (fragment or document) and returns the content.
|
| |
| | muteErrorHandler ($errno, $errstr) |
| | An error handler that mutes all errors.
|
| |
| | normalize ($html, $config, $context) |
| | Takes a piece of HTML and normalizes it by converting entities, fixing encoding, extracting bits, and other good stuff.
|
| |
|
| parseAttr ($string, $config) |
| |
| | parseData ($string, $is_attr, $config) |
| | Parses special entities into the proper characters.
|
| |
|
| parseText ($string, $config) |
| |
| | tokenizeHTML ($html, $config, $context) |
| |
|
| static | create ($config) |
| | Retrieves or sets the default Lexer as a Prototype Factory.
|
| |
|
| | $tracksLineNumbers = false |
| | Whether or not this lexer implements line-number/column-number tracking.
|
| |
|
| | createEndNode ($node, &$tokens) |
| |
| | createStartNode ($node, &$tokens, $collect, $config) |
| |
| | getData ($node) |
| | Portably retrieve the data of a node; deals with older versions of libxml like 2.7.6.
|
| |
| | getTagName ($node) |
| | Portably retrieve the tag name of a node; deals with older versions of libxml like 2.7.6.
|
| |
| | tokenizeDOM ($node, &$tokens, $config) |
| | Iterative function that tokenizes a node, putting it into an accumulator.
|
| |
| | transformAttrToAssoc ($node_map) |
| | Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.
|
| |
| | wrapHTML ($html, $config, $context, $use_div=true) |
| | Wraps an HTML fragment in the necessary HTML.
|
| |
|
| static | CDATACallback ($matches) |
| | Callback function for escapeCDATA() that does the work.
|
| |
| static | escapeCDATA ($string) |
| | Translates CDATA sections into regular sections (through escaping).
|
| |
| static | escapeCommentedCDATA ($string) |
| | Special CDATA case that is especially convoluted for <script>
|
| |
| static | removeIEConditional ($string) |
| | Special Internet Explorer conditional comments should be removed.
|
| |
◆ __construct()
| HTMLPurifier_Lexer_DOMLex::__construct |
( |
| ) |
|
◆ callbackArmorCommentEntities()
| HTMLPurifier_Lexer_DOMLex::callbackArmorCommentEntities |
( |
| $matches | ) |
|
Callback function that entity-izes ampersands in comments so that callbackUndoCommentSubst doesn't clobber them.
- Parameters
-
- Return values
-
◆ callbackUndoCommentSubst()
| HTMLPurifier_Lexer_DOMLex::callbackUndoCommentSubst |
( |
| $matches | ) |
|
Callback function for undoing escaping of stray angled brackets in comments.
- Parameters
-
- Return values
-
◆ CDATACallback()
| static HTMLPurifier_Lexer::CDATACallback |
( |
| $matches | ) |
|
|
staticprotectedinherited |
Callback function for escapeCDATA() that does the work.
- Warning
- Though this is public in order to let the callback happen, calling it directly is not recommended.
- Parameters
-
| array | $matches | PCRE matches array, with index 0 the entire match and 1 the inside of the CDATA section. |
- Return values
-
| string | Escaped internals of the CDATA section. |
◆ create()
| static HTMLPurifier_Lexer::create |
( |
| $config | ) |
|
|
staticinherited |
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.
- Note
- The behavior of this class has changed, rather than accepting a prototype object, it now accepts a configuration object. To specify your own prototype, set Core.LexerImpl to it. This change in behavior de-singletonizes the lexer object.
- Parameters
-
- Return values
-
- Exceptions
-
◆ createEndNode()
| HTMLPurifier_Lexer_DOMLex::createEndNode |
( |
| $node, |
|
|
& | $tokens ) |
|
protected |
◆ createStartNode()
| HTMLPurifier_Lexer_DOMLex::createStartNode |
( |
| $node, |
|
|
& | $tokens, |
|
|
| $collect, |
|
|
| $config ) |
|
protected |
- Parameters
-
| 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. |
- Return values
-
| bool | if the token needs an endtoken |
- Todo
- data and tagName properties don't seem to exist in DOMNode?
◆ escapeCDATA()
| static HTMLPurifier_Lexer::escapeCDATA |
( |
| $string | ) |
|
|
staticprotectedinherited |
Translates CDATA sections into regular sections (through escaping).
- Parameters
-
| string | $string | HTML string to process. |
- Return values
-
| string | HTML with CDATA sections escaped. |
◆ escapeCommentedCDATA()
| static HTMLPurifier_Lexer::escapeCommentedCDATA |
( |
| $string | ) |
|
|
staticprotectedinherited |
Special CDATA case that is especially convoluted for <script>
- Parameters
-
| string | $string | HTML string to process. |
- Return values
-
| string | HTML with CDATA sections escaped. |
◆ extractBody()
| HTMLPurifier_Lexer::extractBody |
( |
| $html | ) |
|
|
inherited |
Takes a string of HTML (fragment or document) and returns the content.
- Todo
- Consider making protected
◆ getData()
| HTMLPurifier_Lexer_DOMLex::getData |
( |
| $node | ) |
|
|
protected |
Portably retrieve the data of a node; deals with older versions of libxml like 2.7.6.
- Parameters
-
◆ getTagName()
| HTMLPurifier_Lexer_DOMLex::getTagName |
( |
| $node | ) |
|
|
protected |
Portably retrieve the tag name of a node; deals with older versions of libxml like 2.7.6.
- Parameters
-
◆ muteErrorHandler()
| HTMLPurifier_Lexer_DOMLex::muteErrorHandler |
( |
| $errno, |
|
|
| $errstr ) |
An error handler that mutes all errors.
- Parameters
-
◆ normalize()
| HTMLPurifier_Lexer::normalize |
( |
| $html, |
|
|
| $config, |
|
|
| $context ) |
|
inherited |
Takes a piece of HTML and normalizes it by converting entities, fixing encoding, extracting bits, and other good stuff.
- Parameters
-
- Return values
-
- Todo
- Consider making protected
◆ parseData()
| HTMLPurifier_Lexer::parseData |
( |
| $string, |
|
|
| $is_attr, |
|
|
| $config ) |
|
inherited |
Parses special entities into the proper characters.
This string will translate escaped versions of the special characters into the correct ones.
- Parameters
-
| string | $string | String character data to be parsed. |
- Return values
-
| string | Parsed character data. |
◆ removeIEConditional()
| static HTMLPurifier_Lexer::removeIEConditional |
( |
| $string | ) |
|
|
staticprotectedinherited |
Special Internet Explorer conditional comments should be removed.
- Parameters
-
| string | $string | HTML string to process. |
- Return values
-
| string | HTML with conditional comments removed. |
◆ tokenizeDOM()
| HTMLPurifier_Lexer_DOMLex::tokenizeDOM |
( |
| $node, |
|
|
& | $tokens, |
|
|
| $config ) |
|
protected |
Iterative function that tokenizes a node, putting it into an accumulator.
To iterate is human, to recurse divine - L. Peter Deutsch
- Parameters
-
| DOMNode | $node | DOMNode to be tokenized. |
| HTMLPurifier_Token[] | $tokens | Array-list of already tokenized tokens. |
◆ tokenizeHTML()
| HTMLPurifier_Lexer_DOMLex::tokenizeHTML |
( |
| $html, |
|
|
| $config, |
|
|
| $context ) |
◆ transformAttrToAssoc()
| HTMLPurifier_Lexer_DOMLex::transformAttrToAssoc |
( |
| $node_map | ) |
|
|
protected |
Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array.
- Parameters
-
| DOMNamedNodeMap | $node_map | DOMNamedNodeMap of DOMAttr objects. |
- Return values
-
| array | Associative array of attributes. |
◆ wrapHTML()
| HTMLPurifier_Lexer_DOMLex::wrapHTML |
( |
| $html, |
|
|
| $config, |
|
|
| $context, |
|
|
| $use_div = true ) |
|
protected |
Wraps an HTML fragment in the necessary HTML.
- Parameters
-
- Return values
-
◆ $_special_entity2str
| HTMLPurifier_Lexer::$_special_entity2str |
|
protectedinherited |
Initial value:=
array(
'"' => '"',
'&' => '&',
'<' => '<',
'>' => '>',
''' => "'",
''' => "'",
''' => "'"
)
Most common entity to raw value conversion table for special entities.
@type array
◆ $tracksLineNumbers
| HTMLPurifier_Lexer::$tracksLineNumbers = false |
|
inherited |
Whether or not this lexer implements line-number/column-number tracking.
If it does, set to true.
The documentation for this class was generated from the following file:
- lib/htmlpurifier/HTMLPurifier/Lexer/DOMLex.php