Add ParserPreSaveTransformComplete hook
This is needed to migrate an extension (AutoWIGO2) that uses ArticleSave to a version of MW after that hook was removed. The extension was using ArticleSave to do its own PST processing, which probably doesn't work with PageContentSave, and wasn't really the right way to do it in the first place. Surprisingly, there were no useful hooks in PST or its callers. Change-Id: If1b3d7ea130a2b77609afe206eedc8445e1ab9f9
This commit is contained in:
parent
8fbce45219
commit
eb6c5f70d9
3 changed files with 10 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ For notes on 1.34.x and older releases, see HISTORY.
|
|||
* FileDeleteForm's constructor now accepts a user as the second parameter.
|
||||
Support for not passing a user has also been hard-deprecated and will be
|
||||
removed in 1.36.
|
||||
* The ParserPreSaveTransformComplete hook was added.
|
||||
* …
|
||||
|
||||
=== External library changes in 1.35 ===
|
||||
|
|
|
|||
|
|
@ -2650,6 +2650,12 @@ $parserOutput: The ParserOutput object.
|
|||
&$text: The text being transformed, before core transformations are done.
|
||||
&$options: The options array being used for the transformation.
|
||||
|
||||
'ParserPreSaveTransformComplete': Called from Parser::preSaveTransform() after
|
||||
processing is complete, giving the extension a chance to further modify the
|
||||
wikitext.
|
||||
$parser: the calling Parser instance
|
||||
&$text: The transformed text, which can be modified by the hook
|
||||
|
||||
'ParserSectionCreate': Called each time the parser creates a document section
|
||||
from wikitext. Use this to apply per-section modifications to HTML (like
|
||||
wrapping the section in a DIV). Caveat: DIVs are valid wikitext, and a DIV
|
||||
|
|
|
|||
|
|
@ -4658,6 +4658,9 @@ class Parser {
|
|||
}
|
||||
$text = $this->mStripState->unstripBoth( $text );
|
||||
|
||||
Hooks::run( 'ParserPreSaveTransformComplete',
|
||||
[ $this, &$text ] );
|
||||
|
||||
$this->setUser( null ); # Reset
|
||||
|
||||
return $text;
|
||||
|
|
|
|||
Loading…
Reference in a new issue