TidyDriverBase.php 508 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace MediaWiki\Tidy;
  3. /**
  4. * Base class for HTML cleanup utilities
  5. */
  6. abstract class TidyDriverBase {
  7. protected $config;
  8. function __construct( $config ) {
  9. $this->config = $config;
  10. }
  11. /**
  12. * Return true if validate() can be used
  13. * @return bool
  14. */
  15. public function supportsValidate() {
  16. return false;
  17. }
  18. /**
  19. * Clean up HTML
  20. *
  21. * @param string $text HTML document fragment to clean up
  22. * @return string The corrected HTML output
  23. */
  24. abstract public function tidy( $text );
  25. }