Class HTMLPurifier_ElementDef

InheritanceHTMLPurifier_ElementDef

Structure that stores an HTML element definition. Used by HTMLPurifier_HTMLDefinition and HTMLPurifier_HTMLModule.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$attr Associative array of attribute name to HTMLPurifier_AttrDef. HTMLPurifier_ElementDef
$attr_transform_post List of tags HTMLPurifier_AttrTransform to be done after validation. HTMLPurifier_ElementDef
$attr_transform_pre List of tags HTMLPurifier_AttrTransform to be done before validation. HTMLPurifier_ElementDef
$autoclose This tag is explicitly auto-closed by the following tags. HTMLPurifier_ElementDef
$child HTMLPurifier_ChildDef of this tag. HTMLPurifier_ElementDef
$content_model Abstract string representation of internal ChildDef rules. HTMLPurifier_ElementDef
$content_model_type Value of $child->type, used to determine which ChildDef to use, used in combination with $content_model. HTMLPurifier_ElementDef
$descendants_are_inline Does the element have a content model (#PCDATA | Inline)*? This is important for chameleon ins and del processing in HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't have to worry about this one. HTMLPurifier_ElementDef
$excludes Lookup table of tags excluded from all descendants of this tag. HTMLPurifier_ElementDef
$formatting Whether or not this is a formatting element affected by the "Active Formatting Elements" algorithm. HTMLPurifier_ElementDef
$required_attr List of the names of required attributes this element has. HTMLPurifier_ElementDef
$standalone Does the definition work by itself, or is it created solely for the purpose of merging into another definition? HTMLPurifier_ElementDef
$wrap If a foreign element is found in this element, test if it is allowed by this sub-element; if it is, instead of closing the current element, place it inside this element. HTMLPurifier_ElementDef

Public Methods

Hide inherited methods

MethodDescriptionDefined By
create() Low-level factory constructor for creating new standalone element defs HTMLPurifier_ElementDef
mergeIn() Merges the values of another element definition into this one. HTMLPurifier_ElementDef

Property Details

$attr public property
public $attr = []
$attr_transform_post public property
$attr_transform_pre public property
public $attr_transform_pre = []
$autoclose public property
public $autoclose = []
$child public property
public $child null
$content_model public property

See also HTMLPurifier_ContentSets for how this is parsed and then transformed into an HTMLPurifier_ChildDef.

public $content_model null
$content_model_type public property
public $content_model_type null
$descendants_are_inline public property
public $descendants_are_inline false
$excludes public property
public $excludes = []
$formatting public property
public $formatting null
$required_attr public property

Dynamically populated by HTMLPurifier_HTMLDefinition::getElement()

public $required_attr = []
$standalone public property
public $standalone true
$wrap public property
public $wrap null

Method Details

create() public static method

Low-level factory constructor for creating new standalone element defs

public static void create ( $content_model, $content_model_type, $attr )
$content_model
$content_model_type
$attr
mergeIn() public method

Merges the values of another element definition into this one.

Values from the new element def take precedence if a value is not mergeable.

public void mergeIn ( $def )
$def HTMLPurifier_ElementDef