extends |
HTMLPurifier_Definition |
---|
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.
Methods | ||||||||
---|---|---|---|---|---|---|---|---|
public
|
addAttribute(string $element_name, string $attr_name, mixed $def)
Adds a custom attribute to a pre-existing element
Adds a custom attribute to a pre-existing element Parameters
|
# | ||||||
public
|
addElement($element_name, $type, $contents, $attr_collections, $attributes = [])
Adds a custom element to your HTML definition
Adds a custom element to your HTML definition |
# | ||||||
public
|
addBlankElement(string $element_name): HTMLPurifier_ElementDef
Adds a blank element to your HTML definition, for overriding
existing behavior
Adds a blank element to your HTML definition, for overriding existing behavior |
# | ||||||
public
|
getAnonymousModule(): HTMLPurifier_HTMLModule
Retrieves a reference to the anonymous module, so you can
bust out advanced features without having to make your own…
Retrieves a reference to the anonymous module, so you can bust out advanced features without having to make your own module. |
# | ||||||
public
|
__construct()
Performs low-cost, preliminary initialization.
Performs low-cost, preliminary initialization. |
# | ||||||
protected
|
doSetup(HTMLPurifier_Config $config)
Sets up the definition object into the final form, something
not done by the constructor
Sets up the definition object into the final form, something not done by the constructor Implements |
# | ||||||
protected
|
processModules(HTMLPurifier_Config $config)
Extract out the information from the manager
Extract out the information from the manager |
# | ||||||
protected
|
setupConfigStuff(HTMLPurifier_Config $config)
Sets up stuff based on config. We need a better way of doing this.
Sets up stuff based on config. We need a better way of doing this. |
# | ||||||
public
|
parseTinyMCEAllowedList(array $list): array
Parses a TinyMCE-flavored Allowed Elements and Attributes list into
separate lists for processing. Format is element…
Parses a TinyMCE-flavored Allowed Elements and Attributes list into separate lists for processing. Format is element[attr1|attr2],element2... Parameters
|
# |
Methods inherited from HTMLPurifier_Definition |
---|
setup() |
Properties | |||
---|---|---|---|
public
|
|
$info = []
Associative array of element names to HTMLPurifier_ElementDef.
Associative array of element names to HTMLPurifier_ElementDef. |
# |
public
|
|
$info_global_attr = []
Associative array of global attribute name to attribute definition.
Associative array of global attribute name to attribute definition. |
# |
public
|
|
$info_parent = 'div'
String name of parent element HTML will be going into.
String name of parent element HTML will be going into. |
# |
public
|
|
$info_parent_def
Definition for parent element, allows parent element to be a
tag that's not allowed inside the HTML fragment.
Definition for parent element, allows parent element to be a tag that's not allowed inside the HTML fragment. |
# |
public
|
|
$info_block_wrapper = 'p'
String name of element used to wrap inline elements in block context.
String name of element used to wrap inline elements in block context. |
# |
public
|
|
$info_tag_transform = []
Associative array of deprecated tag name to HTMLPurifier_TagTransform.
Associative array of deprecated tag name to HTMLPurifier_TagTransform. |
# |
public
|
|
$info_attr_transform_pre = []
Indexed list of HTMLPurifier_AttrTransform to be performed before validation.
Indexed list of HTMLPurifier_AttrTransform to be performed before validation. |
# |
public
|
|
$info_attr_transform_post = []
Indexed list of HTMLPurifier_AttrTransform to be performed after validation.
Indexed list of HTMLPurifier_AttrTransform to be performed after validation. |
# |
public
|
|
$info_content_sets = []
Nested lookup array of content set name (Block, Inline) to
element name to whether or not it belongs in that content…
Nested lookup array of content set name (Block, Inline) to element name to whether or not it belongs in that content set. |
# |
public
|
|
$info_injector = []
Indexed list of HTMLPurifier_Injector to be used.
Indexed list of HTMLPurifier_Injector to be used. |
# |
public
|
|
$doctype
Doctype object
Doctype object |
# |
public
|
|
$type = 'HTML'
|
# |
public
|
|
$manager
|
# |
Properties inherited from HTMLPurifier_Definition |
---|
$setup, $optimized, |