From 99b92f701c7bb0e79d1e4a2154276a0290f3912b Mon Sep 17 00:00:00 2001 From: NovemLinguae Date: Fri, 23 Aug 2024 15:25:47 -0700 Subject: [PATCH] fix detection of {{OKA}} banner should be placed in the banner shell --- src/modules/core.js | 2 +- tests/test-core.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/modules/core.js b/src/modules/core.js index c12b3614..c03565b1 100644 --- a/src/modules/core.js +++ b/src/modules/core.js @@ -1653,7 +1653,7 @@ addTalkPageBanners: function ( wikicode, newAssessment, revId, isBiography, newWikiProjects, lifeStatus, subjectName ) { // build an array of all banners already on page var bannerTemplates = 'wikiproject (?!banner)|football|oka'; - var bannerTemplateRegEx = new RegExp( '{{(?:' + bannerTemplates + ')[^}]+}}', 'gi' ); + var bannerTemplateRegEx = new RegExp( '{{(?:' + bannerTemplates + ')[^}]*}}', 'gi' ); var banners = wikicode.match( bannerTemplateRegEx ) || []; // delete all banners already on page diff --git a/tests/test-core.js b/tests/test-core.js index 23baf169..1f275329 100644 --- a/tests/test-core.js +++ b/tests/test-core.js @@ -388,6 +388,25 @@ I have a question. Can you help answer it? –[[User:Novem Linguae|