Prefer Html::rawElement instead of open/closeElement

Html::open/closeElement are hard to read and possibly error
prone. We can easily avoid it in this case here.

Change-Id: I2251cb63e58bc132ced0bb684e3f0e3be35ab1aa
This commit is contained in:
Thiemo Kreuz 2020-09-09 16:48:20 +02:00
parent 6dd0b66fea
commit eeffc4bf38

View file

@ -710,9 +710,7 @@ class TemplateDataBlob {
$formatMsg = 'custom';
}
$sorting = count( (array)$data->params ) > 1 ? " sortable" : "";
$html =
Html::openElement( 'div', [ 'class' => 'mw-templatedata-doc-wrap' ] )
. Html::element(
$html = Html::element(
'p',
[
'class' => [
@ -879,10 +877,9 @@ class TemplateDataBlob {
)
. '</tr>';
}
$html .= '</tbody></table>'
. Html::closeElement( 'div' );
$html .= '</tbody></table>';
return $html;
return Html::rawElement( 'div', [ 'class' => 'mw-templatedata-doc-wrap' ], $html );
}
/**