Revert "Remove use of deprecated HtmlInputTransformHelper::init(..."

Revert submission 1039794-split-render-id

Reason for revert: Depends-On has not been merged yet so this
is causing CI issues.
Reverted changes: /r/q/submissionid:1039794-split-render-id

Change-Id: Ifcb43e8e3dd845c146498562b398affe2936593f
This commit is contained in:
Jdlrobson 2024-07-02 22:13:06 +00:00
parent e64037f19d
commit eb3b47be84

View file

@ -87,6 +87,8 @@ class DirectParsoidClient implements ParsoidClient {
string $etag = null,
Bcp47Code $pageLanguage = null
): HtmlInputTransformHelper {
$helper = $this->helperFactory->newHtmlInputTransformHelper();
// Fake REST body
$body = [
'html' => [
@ -94,24 +96,17 @@ class DirectParsoidClient implements ParsoidClient {
]
];
$metrics = MediaWikiServices::getInstance()->getParsoidSiteConfig()->metrics();
if ( $metrics ) {
$helper->setMetrics( $metrics );
}
if ( $oldid || $etag ) {
$body['original']['revid'] = $oldid;
$body['original']['renderid'] = $etag;
}
$helper = $this->helperFactory->newHtmlInputTransformHelper(
/* envOptions: */ [],
$page,
$body,
/* parameters: */ [],
/* originalRevision: */ null,
$pageLanguage
);
$metrics = MediaWikiServices::getInstance()->getParsoidSiteConfig()->metrics();
if ( $metrics ) {
$helper->setMetrics( $metrics );
}
$helper->init( $page, $body, [], null, $pageLanguage );
return $helper;
}