22 private static function openLinksInNewWindow(
string &$html ):
void {
23 $html = HtmlHelper::modifyElements(
25 static function ( SerializerNode $node ):
bool {
26 return $node->name ===
'a'
27 && isset( $node->attrs[
'href'] )
28 && !str_contains( $node->attrs[
'class'] ??
'',
'mw-authentication-popup-link' );
30 static function ( SerializerNode $node ): SerializerNode {
31 $node->attrs[
'target'] ??=
'_blank';
39 $data = parent::getTemplateData();
43 self::openLinksInNewWindow( $data[
'html-body-content'] );
44 foreach ( $data[
'data-footer'] as &$footerItems ) {
45 foreach ( $footerItems[
'array-items'] as &$item ) {
46 self::openLinksInNewWindow( $item[
'html'] );