Fix parse wikitext fragment in paction wikitext.

Whenever wikitext content is inserted by the hook `EditFormPreloadText`,
it is always parsed to visual editor markup even when in wikitext mode.

Bug: T206838
Change-Id: I56f0fb9d4e1519af01155c35d4d0068076de4600
This commit is contained in:
Nasty 2018-10-11 15:32:19 +00:00 committed by Bartosz Dziewoński
parent bedbd5b152
commit 124addddaf

View file

@ -368,7 +368,7 @@ class ApiVisualEditor extends ApiBase {
} else {
$content = '';
Hooks::run( 'EditFormPreloadText', [ &$content, &$title ] );
if ( $content !== '' ) {
if ( $content !== '' && $params['paction'] !== 'wikitext' ) {
$content = $this->parseWikitextFragment( $title, $content, true );
}
if ( $content === '' && !empty( $params['preload'] ) ) {