34 private static function openLinksInNewWindow(
string &$html ):
void {
35 $html = HtmlHelper::modifyElements(
37 static function ( SerializerNode $node ):
bool {
38 return $node->name ===
'a'
39 && isset( $node->attrs[
'href'] )
40 && !str_contains( $node->attrs[
'class'] ??
'',
'mw-authentication-popup-link' );
42 static function ( SerializerNode $node ): SerializerNode {
43 $node->attrs[
'target'] ??=
'_blank';
50 $data = parent::getTemplateData();
54 self::openLinksInNewWindow( $data[
'html-body-content'] );
55 foreach ( $data[
'data-footer'] as &$footerItems ) {
56 foreach ( $footerItems[
'array-items'] as &$item ) {
57 self::openLinksInNewWindow( $item[
'html'] );