4 * Defines allowed child nodes and validates tokens against it.
6 abstract class HTMLPurifier_ChildDef
9 * Type of child definition, usually right-most part of class name lowercase.
10 * Used occasionally in terms of context.
15 * Bool that indicates whether or not an empty array of children is okay
17 * This is necessary for redundant checking when changes affecting
18 * a child node may cause a parent node to now be disallowed.
23 * Lookup array of all elements that this definition could possibly allow
25 public $elements = array();
28 * Get lookup of tag names that should not close this element automatically.
29 * All other elements will do so.
31 public function getAllowedElements($config) {
32 return $this->elements
;
36 * Validates nodes according to definition and returns modification.
38 * @param $tokens_of_children Array of HTMLPurifier_Token
39 * @param $config HTMLPurifier_Config object
40 * @param $context HTMLPurifier_Context object
41 * @return bool true to leave nodes as is
42 * @return bool false to remove parent node
43 * @return array of replacement child tokens
45 abstract public function validateChildren($tokens_of_children, $config, $context);