From efcea65ef8275b886b6cd4644da377acea2faf4c Mon Sep 17 00:00:00 2001 From: DR-WP <143805920+DreamRimmer@users.noreply.github.com> Date: Sun, 20 Oct 2024 05:09:44 +0530 Subject: [PATCH] Remove {{Draftcat}} when accepting (#387) * Remove {{Draftcat}} when accepting {{Draftcat}} is a redirect to {{Draft categories}}. AFCH only detects and removes the latter when accepting a draft, but now it will also remove {{Draftcat}}. * tests for submission.js * Delete tests/test-submission.js --- src/modules/submissions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/submissions.js b/src/modules/submissions.js index 7095dde6..efd13814 100644 --- a/src/modules/submissions.js +++ b/src/modules/submissions.js @@ -533,7 +533,7 @@ if ( isAccept ) { // Remove {{Draft categories}} - text = text.replace( /\{\{Draft categories\s*\|((?:\s*\[\[:?Category:[ \S]+?\]\]\s*)*)\s*\}\}/gi, '$1' ); + text = text.replace( /\{\{(?:Draft categories|Draftcat)\s*\|((?:\s*\[\[:?Category:[ \S]+?\]\]\s*)*)\s*\}\}/gi, '$1' ); // Remove {{Draft article}} (and {{Draft}}). // Not removed if the |text= parameter is present, which could contain