Temporarily disable isPreview in Parsoid's rendering

This will let us render reply links on wikitech and run visual diffs
(which runs in anonymous user mode). This will be reverted after
the visual diff test run.

Change-Id: Ibf175a7f5b1e68f66c257fc26ba9e4b55f752fbd
This commit is contained in:
Subramanya Sastry 2023-12-12 13:46:32 -06:00
parent ba7e8417a6
commit d004c001be

View file

@ -86,9 +86,14 @@ class ParserHooks implements
* @inheritDoc
*/
public function onParserOutputPostCacheTransform( $parserOutput, &$text, &$options ): void {
// TEMPORARY for wikitech visualdiff testing: Pin this to false so we
// always render reply links (for anon users as well) to match current
// behavior which also lets us run a truer visual diff with DT.
//
// NOTE: This is a temporary proxy for 'isPreview' flag in ParserOptions.
// It is not clear whether 'editsectionEditLinks' is disabled only for previews.
$isPreview = empty( $options['enableSectionEditLinks'] );
// $isPreview = empty( $options['enableSectionEditLinks'] );
$isPreview = false;
// We want to run this hook only on Parsoid HTML for now.
// (and leave the onParserAfterTidy handler for legacy HTML).