\HTMLPurifier_HTMLDefinition
Definition of the purified HTML that describes allowed children, attributes, and many other things.
Conventions:
All member variables that are prefixed with info
(including the main $info array) are used by HTML Purifier internals
and should not be directly edited when customizing the HTMLDefinition.
They can usually be set via configuration directives or custom
modules.
On the other hand, member variables without the info prefix are used
internally by the HTMLDefinition and MUST NOT be used by other HTML
Purifier internals. Many of them, however, are public, and may be
edited by userspace code to tweak the behavior of HTMLDefinition.
Synopsis
class HTMLPurifier_HTMLDefinition
extends HTMLPurifier_Definition
{
- // members
- public array $info = ;
- public array $info_global_attr = ;
- public string $info_parent = 'div';
- public $info_parent_def;
- public string $info_block_wrapper = 'p';
- public array $info_tag_transform = ;
- public array $info_attr_transform_pre = ;
- public array $info_attr_transform_post = ;
- public array $info_content_sets = ;
- public array $info_injector = ;
- public $doctype;
- private $_anonModule;
- public string $type = 'HTML';
- public $manager;
- // methods
- public void addAttribute()
- public void addElement()
- public void addBlankElement()
- public void getAnonymousModule()
- public void __construct()
- protected void doSetup()
- protected void processModules()
- protected void setupConfigStuff()
- public void parseTinyMCEAllowedList()
- // Inherited methods from HTMLPurifier_Definition
- protected abstract void doSetup()
- public void setup()
Hierarchy
Extends
Tasks
Line | Task |
---|---|
392+ | Give this its own class, probably static interface |
Members
private
- $_anonModule
public
-
$doctype
Doctype object -
$info
Associative array of element names to HTMLPurifier_ElementDef -
$info_attr_transform_post
Indexed list of HTMLPurifier_AttrTransform to be performed after validation. -
$info_attr_transform_pre
Indexed list of HTMLPurifier_AttrTransform to be performed before validation. -
$info_block_wrapper
String name of element used to wrap inline elements in block context -
$info_content_sets
Nested lookup array of content set name (Block, Inline) to element name to whether or not it belongs in that content set. -
$info_global_attr
Associative array of global attribute name to attribute definition. -
$info_injector
Indexed list of HTMLPurifier_Injector to be used. -
$info_parent
String name of parent element HTML will be going into. -
$info_parent_def
Definition for parent element, allows parent element to be a tag that's not allowed inside the HTML fragment. -
$info_tag_transform
Associative array of deprecated tag name to HTMLPurifier_TagTransform - $manager
-
$setup
Has setup() been called yet? - $type
-
$type
What type of definition is it?
Methods
protected
- doSetup()
- processModules() — Extract out the information from the manager
- setupConfigStuff() — Sets up stuff based on config. We need a better way of doing this.
public
- __construct() — Performs low-cost, preliminary initialization.
- addAttribute() — Adds a custom attribute to a pre-existing element
- addBlankElement() — Adds a blank element to your HTML definition, for overriding existing behavior
- addElement() — Adds a custom element to your HTML definition
- getAnonymousModule() — Retrieves a reference to the anonymous module, so you can bust out advanced features without having to make your own module.
- parseTinyMCEAllowedList() — Parses a TinyMCE-flavored Allowed Elements and Attributes list into separate lists for processing. Format is element[attr1|attr2],element2...
Inherited from HTMLPurifier_Definition
protected
- doSetup() — Sets up the definition object into the final form, something not done by the constructor
public
- setup() — Setup function that aborts if already setup