Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / tidy / TidyDriverBase.php
blobced694e323a8773fed9d0d397639a956c8b1ef95
1 <?php
3 namespace MediaWiki\Tidy;
5 /**
6 * Base class for HTML cleanup utilities
7 */
8 abstract class TidyDriverBase {
9 /** @var array */
10 protected $config;
12 public function __construct( $config ) {
13 $this->config = $config;
16 /**
17 * Clean up HTML
19 * @param string $text HTML document fragment to clean up
20 * @param ?callable $textProcessor A callback to run on the contents of
21 * text nodes (not elements or attribute values). This can be used to
22 * apply text modifications like french spacing or smart quotes, without
23 * affecting element or attribute markup.
24 * @return string The corrected HTML output
26 abstract public function tidy( $text, ?callable $textProcessor = null );