From 27307210d1681d1e124d24da9c8008e532bb851e Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 08:46:59 -0600 Subject: [PATCH 1/8] Swap the default for PortableInfoboxUseHeadings to false --- extension.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extension.json b/extension.json index 349d9bbd..4aa18fed 100644 --- a/extension.json +++ b/extension.json @@ -24,7 +24,7 @@ "value": 300 }, "PortableInfoboxUseHeadings": { - "value": true + "value": false }, "PortableInfoboxUseTidy": { "value": true From 1e8891f137ae417f4c3488fffa9b8c9262bd60bf Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 08:49:16 -0600 Subject: [PATCH 2/8] Update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1323a7dc..c6da6400 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can use several variables to modify extension's behaviour: - `$wgAllInfoboxesExcludedSubpages` (array) - list of subpages in template namespace to omit by AllInfoboxes query. (default: [ "doc", "draft", "test" ]) - `$wgPortableInfoboxCacheRenderers` (bool) - cache internal infobox renderers. (default: true) - `$wgPortableInfoboxCustomImageWidth` (int) - size of image thumbnails used in infoboxes. (default: 300) -- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions. (default: true) +- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions as well as Parsoid, for that reason setting this to true is deprecated and this config may eventually be removed. It previously defaulted to true. (default: false) - `$wgPortableInfoboxUseTidy` (bool) - use [RemexHtml](https://www.mediawiki.org/wiki/RemexHtml) for validating HTML in infoboxes (default: true) - `$wgPortableInfoboxResponsiblyOpenCollapsed` (bool) - open collapsed groups when the screen is narrow. (default: true) - `$wgPortableInfoboxUseFileDescriptionPage` (bool) - control whether or not embedded images in the infobox will link to their file description page instead of directly to the file. (default: false) From aae6989a8f53d410abdf84101d7ad65b3a019cb1 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 08:55:37 -0600 Subject: [PATCH 3/8] Update --- ...PortableInfoboxParserTagControllerTest.php | 12 +++---- .../PortableInfoboxRenderServiceTest.php | 34 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php index 503c7ad1..d29a124c 100644 --- a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php +++ b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php @@ -232,7 +232,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-default' => '#fff' ], '', '<default>test</default>', [], @@ -241,7 +241,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -253,7 +253,7 @@ public static function getColorDataProvider() { 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -262,7 +262,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-text-default' => '#fff' ], '', '<default>test</default>', [], @@ -274,7 +274,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -286,7 +286,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], diff --git a/tests/phpunit/Services/PortableInfoboxRenderServiceTest.php b/tests/phpunit/Services/PortableInfoboxRenderServiceTest.php index 8e26ebba..c0e20bbd 100644 --- a/tests/phpunit/Services/PortableInfoboxRenderServiceTest.php +++ b/tests/phpunit/Services/PortableInfoboxRenderServiceTest.php @@ -18,7 +18,7 @@ class PortableInfoboxRenderServiceTest extends MediaWikiIntegrationTestCase { * @return string */ private function normalizeHTML( $html ) { - if ( empty( $html ) ) { + if ( !$html ) { return ''; } @@ -76,7 +76,7 @@ public static function renderInfoboxDataProvider() { ] ], 'output' => '', 'description' => 'Only title', 'accentColor' => '', @@ -94,7 +94,7 @@ public static function renderInfoboxDataProvider() { ] ], 'output' => '', 'description' => 'Only title with custom colors', 'accentColor' => '#FFF', @@ -238,7 +238,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/> ] ], 'output' => '', @@ -281,7 +281,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/> 'output' => '', @@ -311,7 +311,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/> 'output' => '', @@ -371,11 +371,11 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
Test Header
-

test label

+
test label
test value
-

test label

+
test label
test value
@@ -436,11 +436,11 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
Test Header
-

test label

+
test label
test value
-

test label

+
test label
test value
@@ -818,9 +818,9 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

-

Test 3

+
Test 1
+
Test 2
+
Test 3
test value 1
@@ -830,8 +830,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 4

-

Test 5

+
Test 4
+
Test 5
test value 4
@@ -906,9 +906,9 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

-

Test 3

+
Test 1
+
Test 2
+
Test 3
test value 1
@@ -918,7 +918,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 4

+
Test 4
test value 4
@@ -959,7 +959,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

+
Test 1
test value 1
@@ -1011,8 +1011,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

+
Test 1
+
Test 2
test value 1
@@ -1065,8 +1065,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

+
Test 1
+
Test 2
test value 1
@@ -1130,7 +1130,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

+
Test 1
test value 1
@@ -1138,7 +1138,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 2

+
Test 2
test value 2
@@ -1146,7 +1146,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 3

+
Test 3
test value 3
@@ -1242,8 +1242,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

+
Test 1
+
Test 2
test value 1
@@ -1251,14 +1251,14 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 3

+
Test 3
test value 3
-

Test 4

-

Test 5

-

Test 6

+
Test 4
+
Test 5
+
Test 6
test value 4
@@ -1356,9 +1356,9 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

-

Test 3

+
Test 1
+
Test 2
+
Test 3
test value 1
@@ -1368,8 +1368,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 4

-

Test 5

+
Test 4
+
Test 5
test value 4
@@ -1377,7 +1377,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 6

+
Test 6
test value 6
@@ -1437,7 +1437,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

+
Test 1
test value 1
@@ -1445,8 +1445,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 2

-

Test 3

+
Test 2
+
Test 3
test value 2
@@ -1510,7 +1510,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

+
Test 1
test value 1
@@ -1518,7 +1518,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 2

+
Test 2
test value 2
@@ -1526,7 +1526,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 3

+
Test 3
test value 3
@@ -1597,8 +1597,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
-

Test 1

-

Test 2

+
Test 1
+
Test 2
test value 1
@@ -1608,7 +1608,7 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
title value
-

Test 3

+
Test 3
test value 3
@@ -1697,8 +1697,8 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
title value
-

-

Test 4

+
+
Test 4
test value 3
@@ -1836,11 +1836,11 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
Test Header
-

test label

+
test label
test value
-

test label

+
test label
test value
@@ -1901,11 +1901,11 @@ class="pi-image-thumbnail" alt="image alt" width="400" height="200"/>
Test Header
-

test label

+
test label
test value
-

test label

+
test label
test value
From 3f04945c6fad7d840d102984c658ce8299afa448 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 09:43:39 -0600 Subject: [PATCH 5/8] - --- .../PortableInfoboxParserTagControllerTest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php index d29a124c..503c7ad1 100644 --- a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php +++ b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php @@ -232,7 +232,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-default' => '#fff' ], '', '<default>test</default>', [], @@ -241,7 +241,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -253,7 +253,7 @@ public static function getColorDataProvider() { 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -262,7 +262,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-text-default' => '#fff' ], '', '<default>test</default>', [], @@ -274,7 +274,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -286,7 +286,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], From 90fb6f011cb6d66df356a933dcafe76f200a125b Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 09:48:42 -0600 Subject: [PATCH 6/8] + --- ...PortableInfoboxParserTagControllerTest.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php index 503c7ad1..0854217a 100644 --- a/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php +++ b/tests/phpunit/Controllers/PortableInfoboxParserTagControllerTest.php @@ -232,7 +232,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-default' => '#fff' ], '', '<default>test</default>', [], @@ -241,7 +241,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -253,7 +253,7 @@ public static function getColorDataProvider() { 'accent-color-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -262,7 +262,7 @@ public static function getColorDataProvider() { [ [ 'accent-color-text-default' => '#fff' ], '', '<default>test</default>', [], @@ -274,7 +274,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -286,7 +286,7 @@ public static function getColorDataProvider() { 'accent-color-text-source' => 'color-source' ], '', '<default>test</default>', [ 'color-source' => '#000' ], @@ -300,8 +300,8 @@ public static function getColorDataProvider() { 'accent-color-source' => 'color-source2' ], '', '<default>test</default>', [ @@ -319,8 +319,8 @@ public static function getColorDataProvider() { 'accent-color-source' => 'color-source2' ], '', '<default>test</default>', 'templateInvocation' => [ @@ -350,7 +350,7 @@ public function testParamsParsing( $expected, $params ) { $dataNodes = $xpath->query( '//aside/div[contains(@class,\'pi-data\')]' ); for ( $i = 0; $i < $dataNodes->length; $i++ ) { // get map of label => value from parsed data node - $result[$xpath->query( 'h3[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) ) + $result[$xpath->query( 'div[contains(@class, \'pi-data-label\')]', $dataNodes->item( $i ) ) ->item( 0 )->nodeValue] = $xpath->query( 'div[contains(@class, \'pi-data-value\')]', $dataNodes->item( $i ) ) ->item( 0 )->nodeValue; From b41b61d479e60caa43c23df4139c619ed94f4422 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Mon, 9 Mar 2026 10:24:41 -0600 Subject: [PATCH 7/8] Use div --- resources/PortableInfoboxBuilderNodes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/PortableInfoboxBuilderNodes.js b/resources/PortableInfoboxBuilderNodes.js index 671f00c9..8b63b4c8 100644 --- a/resources/PortableInfoboxBuilderNodes.js +++ b/resources/PortableInfoboxBuilderNodes.js @@ -233,7 +233,7 @@ super.html(); if ( this.params.label ) { - let label = document.createElement( 'h3' ); + let label = document.createElement( 'div' ); label.className = 'pi-data-label pi-secondary-font'; label.textContent = this.params.label; this.element.appendChild( label ); @@ -267,7 +267,7 @@ class NodeTitle extends PINode { constructor( markupDoc, params ) { super( markupDoc, params ); - this.elementTag = 'h2'; + this.elementTag = 'div'; this.elementClasses += 'pi-item-spacing pi-title'; this.markupTag = 'title'; } @@ -342,7 +342,7 @@ class NodeHeader extends PINode { constructor( markupDoc, params ) { super( markupDoc, params ); - this.elementTag = 'h2'; + this.elementTag = 'div'; this.elementClasses += 'pi-item-spacing pi-header pi-secondary-font pi-secondary-background'; this.markupTag = 'header'; this.markupContentTag = true; From 14a7bb40af3e7219c6345a1ca666ba3729dff4a3 Mon Sep 17 00:00:00 2001 From: CosmicAlpha Date: Tue, 5 May 2026 15:27:59 -0600 Subject: [PATCH 8/8] - --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6da6400..bac962d6 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ You can use several variables to modify extension's behaviour: - `$wgAllInfoboxesExcludedSubpages` (array) - list of subpages in template namespace to omit by AllInfoboxes query. (default: [ "doc", "draft", "test" ]) - `$wgPortableInfoboxCacheRenderers` (bool) - cache internal infobox renderers. (default: true) - `$wgPortableInfoboxCustomImageWidth` (int) - size of image thumbnails used in infoboxes. (default: 300) -- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions as well as Parsoid, for that reason setting this to true is deprecated and this config may eventually be removed. It previously defaulted to true. (default: false) +- `$wgPortableInfoboxUseHeadings` (bool) - use heading tags for infobox titles and group headers, it may cause incompatibilities with other extensions as well as Parsoid. This config previously defaulted to true. (default: false) - `$wgPortableInfoboxUseTidy` (bool) - use [RemexHtml](https://www.mediawiki.org/wiki/RemexHtml) for validating HTML in infoboxes (default: true) - `$wgPortableInfoboxResponsiblyOpenCollapsed` (bool) - open collapsed groups when the screen is narrow. (default: true) - `$wgPortableInfoboxUseFileDescriptionPage` (bool) - control whether or not embedded images in the infobox will link to their file description page instead of directly to the file. (default: false)