Suppress the empty state in previews again

It wasn't appearing in normal previews thanks to some redundant checks
elsewhere, but it was appearing in our own internal previews using
ApiDiscussionToolsTrait::previewMessage(). It wasn't causing any
problems until change Iac3778a4a88a4def234be9d10b80d9796d35bceb, which
detects headings in the preview, and it was detecting the empty state
heading.

Follow-up to commits 8fb467896f and
ab40ef62c0, where I replaced a HTML
comment with ParserOutput extension data to indicate this, and then
accidentally removed the cleanup code from removeInteractiveTools()
with no replacement.

Change-Id: I4b650f82c711d65e200758e981ce338202deeaa6
This commit is contained in:
Bartosz Dziewoński 2023-06-22 10:24:42 +02:00
parent 28fdcfc132
commit aa239a1ad1

View file

@ -69,6 +69,8 @@ class ParserHooks implements
if ( $parser->getOptions()->getIsPreview() ) {
$text = CommentFormatter::removeInteractiveTools( $text );
// Suppress the empty state
$pout->setExtensionData( 'DiscussionTools-isEmptyTalkPage', null );
}
$pout->addModuleStyles( [