]>
Commit | Line | Data |
---|---|---|
1 | <?php\r | |
2 | \r | |
3 | /**\r | |
4 | * XHTML 1.1 List Module, defines list-oriented elements. Core Module.\r | |
5 | */\r | |
6 | class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule\r | |
7 | {\r | |
8 | /**\r | |
9 | * @type string\r | |
10 | */\r | |
11 | public $name = 'List';\r | |
12 | \r | |
13 | // According to the abstract schema, the List content set is a fully formed\r | |
14 | // one or more expr, but it invariably occurs in an optional declaration\r | |
15 | // so we're not going to do that subtlety. It might cause trouble\r | |
16 | // if a user defines "List" and expects that multiple lists are\r | |
17 | // allowed to be specified, but then again, that's not very intuitive.\r | |
18 | // Furthermore, the actual XML Schema may disagree. Regardless,\r | |
19 | // we don't have support for such nested expressions without using\r | |
20 | // the incredibly inefficient and draconic Custom ChildDef.\r | |
21 | \r | |
22 | /**\r | |
23 | * @type array\r | |
24 | */\r | |
25 | public $content_sets = array('Flow' => 'List');\r | |
26 | \r | |
27 | /**\r | |
28 | * @param HTMLPurifier_Config $config\r | |
29 | */\r | |
30 | public function setup($config)\r | |
31 | {\r | |
32 | $ol = $this->addElement('ol', 'List', new HTMLPurifier_ChildDef_List(), 'Common');\r | |
33 | $ul = $this->addElement('ul', 'List', new HTMLPurifier_ChildDef_List(), 'Common');\r | |
34 | // XXX The wrap attribute is handled by MakeWellFormed. This is all\r | |
35 | // quite unsatisfactory, because we generated this\r | |
36 | // *specifically* for lists, and now a big chunk of the handling\r | |
37 | // is done properly by the List ChildDef. So actually, we just\r | |
38 | // want enough information to make autoclosing work properly,\r | |
39 | // and then hand off the tricky stuff to the ChildDef.\r | |
40 | $ol->wrap = 'li';\r | |
41 | $ul->wrap = 'li';\r | |
42 | $this->addElement('dl', 'List', 'Required: dt | dd', 'Common');\r | |
43 | \r | |
44 | $this->addElement('li', false, 'Flow', 'Common');\r | |
45 | \r | |
46 | $this->addElement('dd', false, 'Flow', 'Common');\r | |
47 | $this->addElement('dt', false, 'Inline', 'Common');\r | |
48 | }\r | |
49 | }\r | |
50 | \r | |
51 | // vim: et sw=4 sts=4\r |