PHP 클래스 HTMLPurifier_Lexer_DOMLex, yii
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.
파일 보기
프로젝트 열기: yiisoft/yii
공개 메소드들
보호된 메소드들
메소드 |
설명 |
|
createEndNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) |
|
|
createStartNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens, boolean $collect ) : boolean |
|
|
tokenizeDOM ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) : HTMLPurifier_Token |
Iterative function that tokenizes a node, putting it into an accumulator. |
|
transformAttrToAssoc ( DOMNamedNodeMap $node_map ) : array |
Converts a DOMNamedNodeMap of DOMAttr objects into an assoc array. |
|
wrapHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : string |
Wraps an HTML fragment in the necessary HTML |
|
메소드 상세
protected createEndNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) |
$node |
DOMNode |
|
$tokens |
HTMLPurifier_Token[] |
|
createStartNode()
보호된 메소드
protected createStartNode ( DOMNode $node, HTMLPurifier_Token[] &$tokens, boolean $collect ) : boolean |
$node |
DOMNode |
DOMNode to be tokenized. |
$tokens |
HTMLPurifier_Token[] |
Array-list of already tokenized tokens. |
$collect |
boolean |
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. |
리턴 |
boolean |
if the token needs an endtoken |
muteErrorHandler()
공개 메소드
An error handler that mutes all errors
To iterate is human, to recurse divine - L. Peter Deutsch
protected tokenizeDOM ( DOMNode $node, HTMLPurifier_Token[] &$tokens ) : HTMLPurifier_Token |
$node |
DOMNode |
DOMNode to be tokenized. |
$tokens |
HTMLPurifier_Token[] |
Array-list of already tokenized tokens. |
리턴 |
HTMLPurifier_Token |
of node appended to previously passed tokens. |
public tokenizeHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : HTMLPurifier_Token[] |
$html |
string |
|
$config |
HTMLPurifier_Config |
|
$context |
HTMLPurifier_Context |
|
리턴 |
HTMLPurifier_Token[] |
|
Wraps an HTML fragment in the necessary HTML
protected wrapHTML ( string $html, HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : string |
$html |
string |
|
$config |
HTMLPurifier_Config |
|
$context |
HTMLPurifier_Context |
|
리턴 |
string |
|