From 0bf726b0596f5f0ed1845118897e3a9e7ae5993a Mon Sep 17 00:00:00 2001 From: NovemLinguae <79697282+NovemLinguae@users.noreply.github.com> Date: Fri, 23 Aug 2024 15:57:56 -0700 Subject: [PATCH] core: add |1= to {{WikiProject banner shell}} (#373) requested at WT:AFC. makes it more readable when there's multiple parameters --- src/modules/core.js | 3 ++- tests/test-core.js | 28 ++++++++++++++-------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/modules/core.js b/src/modules/core.js index 76c1f49f..4e1580dd 100644 --- a/src/modules/core.js +++ b/src/modules/core.js @@ -1719,9 +1719,10 @@ // Convert array back to wikitext and append to top of talk page. // Always add a shell even if it's just wrapping one banner, for code simplification reasons. // Add |class= to shell. + // Add |1=. Improves readability when lots of other parameters present. wikicode = '{{WikiProject banner shell' + ( newAssessment ? '|class=' + newAssessment : '' ) + - '|\n' + + '|1=\n' + banners.join( '\n' ) + '\n}}\n' + wikicode; diff --git a/tests/test-core.js b/tests/test-core.js index f33933bf..f94ec5c1 100644 --- a/tests/test-core.js +++ b/tests/test-core.js @@ -132,7 +132,7 @@ describe( 'AFCH.addTalkPageBanners', function () { var subjectName = ''; var output = AFCH.addTalkPageBanners( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName ); expect( output ).toBe( -`{{WikiProject banner shell| +`{{WikiProject banner shell|1= {{subst:WPAFC/article|oldid=592485}} }}` ); @@ -150,7 +150,7 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|