Skip to content

Commit

Permalink
Remove {{Draftcat}} when accepting (#387)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
DreamRimmer authored Oct 19, 2024
1 parent 2b33a3d commit efcea65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit efcea65

Please sign in to comment.