Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / tidy / TidyDriverBase.php
blob96ee8c394f6c9e5f4222514be5b1327096c9980f
1 <?php
3 namespace MediaWiki\Tidy;
5 /**
6 * Base class for HTML cleanup utilities
7 */
8 abstract class TidyDriverBase {
9 protected $config;
11 function __construct( $config ) {
12 $this->config = $config;
15 /**
16 * Return true if validate() can be used
18 public function supportsValidate() {
19 return false;
22 /**
23 * Check HTML for errors, used if $wgValidateAllHtml = true.
25 * @param string $text
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()" );
33 /**
34 * Clean up HTML
36 * @param string $text HTML document fragment to clean up
37 * @return string The corrected HTML output
39 abstract public function tidy( $text );