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
15 function HTMLPurifier_HTMLModule_Edit() {
16 $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow';
19 // 'datetime' => 'Datetime', // not implemented
21 $this->addElement('del', true, 'Inline', $contents, 'Common', $attr);
22 $this->addElement('ins', true, 'Inline', $contents, 'Common', $attr);
25 // HTML 4.01 specifies that ins/del must not contain block
26 // elements when used in an inline context, chameleon is
27 // a complicated workaround to acheive this effect
29 // Inline context ! Block context (exclamation mark is
30 // separator, see getChildDef for parsing)
32 var $defines_child_def = true;
33 function getChildDef($def) {
34 if ($def->content_model_type
!= 'chameleon') return false;
35 $value = explode('!', $def->content_model
);
36 return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);