This is an HTML5-compliant parse/serialize tidy implementation, with well-delineated hacks to support the <p>-wrapping done by legacy tidy. Change-Id: I4fd433fd6f1847061b0bf4b3e249c918720d4fae
18 lines
372 B
PHP
18 lines
372 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Tidy;
|
|
|
|
class Html5Internal extends TidyDriverBase {
|
|
private $balancer;
|
|
public function __construct( array $config ) {
|
|
parent::__construct( $config + [
|
|
'strict' => true,
|
|
'tidyCompat' => true,
|
|
] );
|
|
$this->balancer = new Balancer( $this->config );
|
|
}
|
|
|
|
public function tidy( $text ) {
|
|
return $this->balancer->balance( $text );
|
|
}
|
|
}
|