Future parsers will not support the output generated with tidy disabled.
Parser tests using untidied output will also be deprecated (and
rewritten) in a follow-up patch.
No new release notes necessary since user-visible tidy configuration
was deprecated previously (in 1.32), and individual methods which had
disabled tidy during execution were individually release-noted as they
were updated.
Bug: T198214
Depends-On: I0f417f75a49dfea873e9a2f44d81796a48b9f428
Depends-On: If5c619cdd3e7f786687cfc2ca166074d9197ca11
Change-Id: I592e0e0dfef7d929f05c60ffe4d60e09725b39cc
} else {
# attempt to sanitize at least some nesting problems
# (T4702 and quite a few others)
+ # This code path is buggy and deprecated!
+ wfDeprecated( 'disabling tidy', '1.33' );
$tidyregs = [
# ''Something [http://www.cool.com cool''] -->
# <i>Something</i><a href="http://www.cool.com"..><i>cool></i></a>
$bits = explode( '<', $text );
$text = str_replace( '>', '>', array_shift( $bits ) );
if ( !MWTidy::isEnabled() ) {
+ wfDeprecated( 'disabling tidy', '1.33' );
$tagstack = $tablestack = [];
foreach ( $bits as $x ) {
$regs = [];
$config = $this->getConfig();
if ( MWTidy::isEnabled() && $options->getTidy() ) {
$tmp = MWTidy::tidy( $tmp );
+ } else {
+ wfDeprecated( 'disabling tidy', '1.33' );
}
$out->addHTML( $tmp );
} else {
$tidy = false;
}
+
+ # Suppress warnings about running tests without tidy
+ Wikimedia\suppressWarnings();
+ wfDeprecated( 'disabling tidy' );
+ Wikimedia\restoreWarnings();
+
MWTidy::setInstance( $tidy );
$teardown[] = function () {
MWTidy::destroySingleton();
* @param bool $escaped Whether sanitizer let the tag in or escape it (ie: '<video>')
*/
public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) {
+ $this->hideDeprecated( 'disabling tidy' );
MWTidy::setInstance( false );
if ( $escaped ) {
* @covers Sanitizer::removeHTMLtags
*/
public function testRemoveHTMLtags( $input, $output, $msg = null ) {
+ $this->hideDeprecated( 'disabling tidy' );
MWTidy::setInstance( false );
$this->assertEquals( $output, Sanitizer::removeHTMLtags( $input ), $msg );
}