wiki.techinc.nl/includes/tidy/Html5Internal.php
C. Scott Ananian ce081a3d7b Hook up Balancer as a Tidy implementation.
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
2016-07-12 14:18:04 +10:00

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 );
}
}