We are incrementally removing places where the parser is used with
tidy disabled, since future parsers will not support such operation.
Bug: T198214
Change-Id: I0f417f75a49dfea873e9a2f44d81796a48b9f428
// either.
$po = ParserOptions::newFromAnon();
$po->setAllowUnsafeRawHtml( false );
+ $po->setTidy( true );
return $po;
}
// from malicious sources. As a precaution, disable
// the <html> parser tag when parsing messages.
$this->mParserOptions->setAllowUnsafeRawHtml( false );
+ // For the same reason, tidy the output!
+ $this->mParserOptions->setTidy( true );
}
return $this->mParserOptions;
$op = $this->newInstance();
$this->assertSame( '', $op->getHTML() );
$op->addWikiMsg( 'parentheses', "<b>a" );
- // This is known to be bad unbalanced HTML; this will be fixed
- // by I743f4185a03403f8d9b9db010ff1ee4e9342e062 (T198214)
- $this->assertSame( "<p>(<b>a)\n</p>", $op->getHTML() );
+ // The input is bad unbalanced HTML, but the output is tidied
+ $this->assertSame( "<p>(<b>a)\n</b></p>", $op->getHTML() );
}
/**