\HTMLPurifier_Generator
Generates HTML from tokens.
Synopsis
class HTMLPurifier_Generator
{
- // members
- private boolean $_xhtml = true;
- private boolean $_scriptFix = false;
- private $_def;
- private $_sortAttr;
- private $_flashCompat;
- private array $_flashStack = ;
- protected $config;
- // methods
- public void __construct()
- public Generated generateFromTokens()
- public Generated generateFromToken()
- public void generateScriptFromToken()
- public Generate generateAttributes()
- public String escape()
Tasks
Line | Task |
---|---|
10+ | Refactor interface so that configuration/context is determined upon instantiation, no need for messy generateFromTokens() calls |
10+ | Make some of the more internal functions protected, and have unit tests work around that |
220+ | This really ought to be protected, but until we have a facility for properly generating HTML here w/o using tokens, it stays public. |
Members
private
-
$_def
Cache of HTMLDefinition during HTML output to determine whether or not attributes should be minimized. -
$_flashCompat
Cache of %Output.FlashCompat -
$_flashStack
Stack for keeping track of object information when outputting IE compatibility code. -
$_scriptFix
:HACK: Whether or not generator should comment the insides of <script> tags -
$_sortAttr
Cache of %Output.SortAttr -
$_xhtml
Whether or not generator should produce XML output
protected
-
$config
Configuration for the generator
Methods
public
- __construct()
- escape() — Escapes raw text data.
- generateAttributes() — Generates attribute declarations from attribute array.
- generateFromToken() — Generates HTML from a single token.
- generateFromTokens() — Generates HTML from an array of tokens.
- generateScriptFromToken() — Special case processor for the contents of script tags