Deprecate ParserBeforeTidy hook

Untidy parser output should not be exposed outside mediawiki core.
Callers should use ParserAfterTidy instead.

Code search:
https://codesearch.wmflabs.org/deployed/?q=ParserBeforeTidy&i=nope&files=&repos=
https://codesearch.wmflabs.org/search/?q=ParserBeforeTidy&i=nope&files=&repos=

Depends-On: Ia6bd94fc937a9bff77843e6734e88ba8991d04ec
Change-Id: I4a0aae7b17fb522a5e4f90edad3a0b7137b270a6
This commit is contained in:
C. Scott Ananian 2020-04-17 00:01:41 -04:00
parent afb5b38e15
commit 95350d3dcf
3 changed files with 5 additions and 2 deletions

View file

@ -884,6 +884,8 @@ because of Phabricator reports.
* No replacement; MediaHandler provides for customizable media rendering
- BeforeParserFetchTemplateAndtitle
* Replace with new BeforeParserFetchTemplateAndTitle hook
- ParserBeforeTidy
* Use ParserAfterTidy instead to avoid exposing internal half-parsed state
* The accessor/mutator methods Parser::Options(), Parser::OutputType(), and
Parser::Title() have been deprecated; use the appropriate Parser::get*
or Parser::set* methods instead.

View file

@ -2586,7 +2586,8 @@ TODO: No more strip, deprecated ?
&$text: text being parsed
[&]$stripState: stripState used (object)
'ParserBeforeTidy': Called before tidy and custom tags replacements.
'ParserBeforeTidy': DEPRECATED since 1.35!
Called before tidy and custom tags replacements.
[&]$parser: Parser object being used
&$text: actual text

View file

@ -1654,7 +1654,7 @@ class Parser {
$text = $this->mStripState->unstripNoWiki( $text );
if ( $isMain ) {
Hooks::run( 'ParserBeforeTidy', [ &$parser, &$text ] );
Hooks::run( 'ParserBeforeTidy', [ &$parser, &$text ], '1.35' );
}
$text = $this->mStripState->unstripGeneral( $text );