Strict.php 906 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class HTMLPurifier_HTMLModule_Tidy_Strict extends HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4
  3. {
  4. /**
  5. * @type string
  6. */
  7. public $name = 'Tidy_Strict';
  8. /**
  9. * @type string
  10. */
  11. public $defaultLevel = 'light';
  12. /**
  13. * @return array
  14. */
  15. public function makeFixes()
  16. {
  17. $r = parent::makeFixes();
  18. $r['blockquote#content_model_type'] = 'strictblockquote';
  19. return $r;
  20. }
  21. /**
  22. * @type bool
  23. */
  24. public $defines_child_def = true;
  25. /**
  26. * @param HTMLPurifier_ElementDef $def
  27. * @return HTMLPurifier_ChildDef_StrictBlockquote
  28. */
  29. public function getChildDef($def)
  30. {
  31. if ($def->content_model_type != 'strictblockquote') {
  32. return parent::getChildDef($def);
  33. }
  34. return new HTMLPurifier_ChildDef_StrictBlockquote($def->content_model);
  35. }
  36. }
  37. // vim: et sw=4 sts=4