From fa65503f5886349332b99670873e1f902566b7dc Mon Sep 17 00:00:00 2001 From: Shashank Atreya Date: Wed, 27 Aug 2025 13:56:39 +0200 Subject: [PATCH 1/2] replace the div with proper 1.43 div --- src/Helper.php | 15 +++++++++++++++ src/Hooks/MainHookHandler.php | 13 +++---------- src/ParserFunction.php | 12 ++---------- 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 src/Helper.php diff --git a/src/Helper.php b/src/Helper.php new file mode 100644 index 0000000..e2e48fc --- /dev/null +++ b/src/Helper.php @@ -0,0 +1,15 @@ +' ), + -strlen( '' ) + ); + } + +} diff --git a/src/Hooks/MainHookHandler.php b/src/Hooks/MainHookHandler.php index 1619919..1cf9478 100644 --- a/src/Hooks/MainHookHandler.php +++ b/src/Hooks/MainHookHandler.php @@ -3,6 +3,7 @@ namespace Liquipedia\Extension\TournamentsMenu\Hooks; use Liquipedia\Extension\TournamentsMenu\Data; +use Liquipedia\Extension\TournamentsMenu\Helper; use MediaWiki\Hook\ParserFirstCallInitHook; use MediaWiki\Hook\SkinBuildSidebarHook; use Title; @@ -70,11 +71,7 @@ public function onSkinBuildSidebar( $skin, &$bar ) { false ); if ( strpos( $iconHTML, 'mw-parser-output' ) !== false ) { - $iconHTML = substr( - $iconHTML, - strlen( '
' ), - -strlen( '
' ) - ); + $iconHTML = Helper::unwrapHtml( $iconHTML ); } $text = $iconHTML . ' ' . $text; } @@ -95,11 +92,7 @@ public function onSkinBuildSidebar( $skin, &$bar ) { false ); if ( strpos( $iconHTML, 'mw-parser-output' ) !== false ) { - $iconHTML = substr( - $iconHTML, - strlen( '
' ), - -strlen( '
' ) - ); + $iconHTML = Helper::unwrapHtml( $iconHTML ); } $text = $iconHTML . ' ' . $text; } diff --git a/src/ParserFunction.php b/src/ParserFunction.php index cb9db52..a690274 100644 --- a/src/ParserFunction.php +++ b/src/ParserFunction.php @@ -86,11 +86,7 @@ public static function getTournamentsList( $content, $attributes, $parser, $fram )->getText(); $parserOptions->setOption( 'enableLimitReport', $wasParserReportEnabled ); if ( strpos( $iconHTML, 'mw-parser-output' ) !== false ) { - $iconHTML = substr( - $iconHTML, - strlen( '
' ), - -strlen( '
' ) - ); + $iconHTML = Helper::unwrapHtml( $iconHTML ); } $return .= Parser::stripOuterParagraph( $iconHTML ); } @@ -121,11 +117,7 @@ public static function getTournamentsList( $content, $attributes, $parser, $fram )->getText(); $parserOptions->setOption( 'enableLimitReport', $wasParserReportEnabled ); if ( strpos( $iconHTML, 'mw-parser-output' ) !== false ) { - $iconHTML = substr( - $iconHTML, - strlen( '
' ), - -strlen( '
' ) - ); + $iconHTML = Helper::unwrapHtml( $iconHTML ); } $return .= Parser::stripOuterParagraph( $iconHTML ); } From d8d8292dfb6d0d2380bf8ce43a51d0dc4d6e4511 Mon Sep 17 00:00:00 2001 From: Shashank Atreya Date: Wed, 27 Aug 2025 13:58:24 +0200 Subject: [PATCH 2/2] fix pipeline --- composer.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 139f1ce..1e529f5 100644 --- a/composer.json +++ b/composer.json @@ -21,5 +21,10 @@ "composer sqllint" ], "fix": "phpcbf" + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + } } }