No HTML needed to validate <templatedata> in wikitext

I tried to benchmark this and yes, it makes a difference, but probably
not a big one. This is an additional parse in addition to the one core
will later do when the page is actually saved. For this one here we
are just not interested in the HTML.

Bug: T305105
Change-Id: I71147af5161c934a822651e80e11f3bd26af56cd
This commit is contained in:
Thiemo Kreuz 2022-04-11 18:25:03 +02:00
parent 9de8c46234
commit 1c8b4ae729

View file

@ -97,7 +97,7 @@ class Hooks {
// Revision hasn't been parsed yet, so parse to know if self::render got a
// valid tag (via inclusion and transclusion) and abort save if it didn't
$parserOutput = $renderedRevision->getRevisionParserOutput();
$parserOutput = $renderedRevision->getRevisionParserOutput( [ 'generate-html' => false ] );
$templateDataStatus = self::getStatusFromParserOutput( $parserOutput );
if ( $templateDataStatus instanceof Status && !$templateDataStatus->isOK() ) {
// Abort edit, show error message from TemplateDataBlob::getStatus