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