]> git.immae.eu Git - github/wallabag/wallabag.git/blame - inc/3rdparty/htmlpurifier/HTMLPurifier/HTMLModule/Edit.php
remove autoload section in composer.json
[github/wallabag/wallabag.git] / inc / 3rdparty / htmlpurifier / HTMLPurifier / HTMLModule / Edit.php
CommitLineData
d4949327
NL
1<?php\r
2\r
3/**\r
4 * XHTML 1.1 Edit Module, defines editing-related elements. Text Extension\r
5 * Module.\r
6 */\r
7class HTMLPurifier_HTMLModule_Edit extends HTMLPurifier_HTMLModule\r
8{\r
9\r
10 /**\r
11 * @type string\r
12 */\r
13 public $name = 'Edit';\r
14\r
15 /**\r
16 * @param HTMLPurifier_Config $config\r
17 */\r
18 public function setup($config)\r
19 {\r
20 $contents = 'Chameleon: #PCDATA | Inline ! #PCDATA | Flow';\r
21 $attr = array(\r
22 'cite' => 'URI',\r
23 // 'datetime' => 'Datetime', // not implemented\r
24 );\r
25 $this->addElement('del', 'Inline', $contents, 'Common', $attr);\r
26 $this->addElement('ins', 'Inline', $contents, 'Common', $attr);\r
27 }\r
28\r
29 // HTML 4.01 specifies that ins/del must not contain block\r
30 // elements when used in an inline context, chameleon is\r
31 // a complicated workaround to acheive this effect\r
32\r
33 // Inline context ! Block context (exclamation mark is\r
34 // separator, see getChildDef for parsing)\r
35\r
36 /**\r
37 * @type bool\r
38 */\r
39 public $defines_child_def = true;\r
40\r
41 /**\r
42 * @param HTMLPurifier_ElementDef $def\r
43 * @return HTMLPurifier_ChildDef_Chameleon\r
44 */\r
45 public function getChildDef($def)\r
46 {\r
47 if ($def->content_model_type != 'chameleon') {\r
48 return false;\r
49 }\r
50 $value = explode('!', $def->content_model);\r
51 return new HTMLPurifier_ChildDef_Chameleon($value[0], $value[1]);\r
52 }\r
53}\r
54\r
55// vim: et sw=4 sts=4\r