3 namespace MediaWiki\Tidy
;
6 * Base class for HTML cleanup utilities
8 abstract class TidyDriverBase
{
11 function __construct( $config ) {
12 $this->config
= $config;
16 * Return true if validate() can be used
18 public function supportsValidate() {
23 * Check HTML for errors, used if $wgValidateAllHtml = true.
26 * @param string &$errorStr Return the error string
27 * @return bool Whether the HTML is valid
29 public function validate( $text, &$errorStr ) {
30 throw new MWException( get_class( $this ) . " does not support validate()" );
36 * @param string $text HTML document fragment to clean up
37 * @return string The corrected HTML output
39 abstract public function tidy( $text );