List.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * XHTML 1.1 List Module, defines list-oriented elements. Core Module.
  4. */
  5. class HTMLPurifier_HTMLModule_List extends HTMLPurifier_HTMLModule
  6. {
  7. public $name = 'List';
  8. // According to the abstract schema, the List content set is a fully formed
  9. // one or more expr, but it invariably occurs in an optional declaration
  10. // so we're not going to do that subtlety. It might cause trouble
  11. // if a user defines "List" and expects that multiple lists are
  12. // allowed to be specified, but then again, that's not very intuitive.
  13. // Furthermore, the actual XML Schema may disagree. Regardless,
  14. // we don't have support for such nested expressions without using
  15. // the incredibly inefficient and draconic Custom ChildDef.
  16. public $content_sets = array('Flow' => 'List');
  17. public function setup($config) {
  18. $ol = $this->addElement('ol', 'List', 'Required: li', 'Common');
  19. $ol->wrap = "li";
  20. $ul = $this->addElement('ul', 'List', 'Required: li', 'Common');
  21. $ul->wrap = "li";
  22. $this->addElement('dl', 'List', 'Required: dt | dd', 'Common');
  23. $this->addElement('li', false, 'Flow', 'Common');
  24. $this->addElement('dd', false, 'Flow', 'Common');
  25. $this->addElement('dt', false, 'Inline', 'Common');
  26. }
  27. }
  28. // vim: et sw=4 sts=4