MediaWiki master
MediaWiki\Tidy\TidyDriverBase Class Reference

Base class for HTML cleanup utilities. More...

Inherited by MediaWiki\Tidy\RemexDriver.

Public Member Functions

 __construct ( $config)
 
 tidy ( $text, ?callable $textProcessor=null)
 Clean up HTML.
 

Protected Attributes

array $config
 

Detailed Description

Base class for HTML cleanup utilities.

Definition at line 8 of file TidyDriverBase.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Tidy\TidyDriverBase::__construct ( $config)

Definition at line 12 of file TidyDriverBase.php.

References MediaWiki\Tidy\TidyDriverBase\$config.

Member Function Documentation

◆ tidy()

MediaWiki\Tidy\TidyDriverBase::tidy ( $text,
?callable $textProcessor = null )
abstract

Clean up HTML.

Parameters
string$textHTML document fragment to clean up
?callable$textProcessorA callback to run on the contents of text nodes (not elements or attribute values). This can be used to apply text modifications like french spacing or smart quotes, without affecting element or attribute markup.
Returns
string The corrected HTML output

Reimplemented in MediaWiki\Tidy\RemexDriver.

Member Data Documentation

◆ $config

array MediaWiki\Tidy\TidyDriverBase::$config
protected

The documentation for this class was generated from the following file: