3 require_once 'HTMLPurifier/HTMLModule.php';
4 require_once 'HTMLPurifier/ChildDef/Chameleon.php';
7 * XHTML 1.1 Edit Module, defines editing-related elements. Text Extension
10 class HTMLPurifier_HTMLModule_Edit
extends HTMLPurifier_HTMLModule
14 var $elements = array('del', 'ins');
15 var $content_sets = array('Inline' => 'del | ins');
17 function HTMLPurifier_HTMLModule_Edit() {
18 foreach ($this->elements
as $element) {
19 $this->info
[$element] = new HTMLPurifier_ElementDef();
20 $this->info
[$element]->attr
= array(
23 // 'datetime' => 'Datetime' // Datetime not implemented
25 // Inline context ! Block context (exclamation mark is
26 // separator, see getChildDef for parsing)
27 $this->info
[$element]->content_model
=
28 '#PCDATA | Inline ! #PCDATA | Flow';
29 // HTML 4.01 specifies that ins/del must not contain block
30 // elements when used in an inline context, chameleon is
31 // a complicated workaround to acheive this effect
32 $this->info
[$element]->content_model_type
= 'chameleon';
36 var $defines_child_def = true;
37 function getChildDef($def) {
38 if ($def->content_model_type
!= 'chameleon') return false;
39 $value = explode('!', $def->content_model
);
40 return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);