I need to update some extension code to work with MW1.39. I believe the problem is because it relies on Manual:$wgParser.
The code is from https://stackoverflow.com/questions/18379992/how-to-use-the-mediawiki-parser-to-get-html-from-wikitext
$text = "Your [[wikitext]]";
$title = $skin->getTitle(); // Get the title object from somewhere or use $wgTitle
$parser = new Parser;
$parserOptions = new ParserOptions;
$parserOutput = $parser->parse( $text, $title, $parserOptions );
$html = $parserOutput->getText();
echo $html;
I think the replacement for the $parser =
line is $parser = \MediaWiki\MediaWikiServices::getInstance()->getParser();
But now $parserOptions = new ParserOptions
needs a UserIdentity object and I'm stuck there.
Any pointers would be gratefully received.