Skip to content

Commit

Permalink
Remove {{promising draft}}, and unify template removal logic
Browse files Browse the repository at this point in the history
  • Loading branch information
siddharthvp committed Nov 4, 2021
1 parent 0c98677 commit b82ad0b
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/modules/submissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,17 +521,17 @@
text = text.replace( /\[\[:Category:/gi, '[[Category:' );
text = text.replace( /\{\{(tl|tlx|tlg)\|(.*?)\}\}/ig, '{{$2}}' );

// Strip the AFC G13 postponement template
text = text.replace( /\{\{AfC postpone G13(?:\|\d*)?\}\}\n*/gi, '' );

// Remove draft topics template
text = text.replace( /\{\{draft topics\|(.*?)\}\}\n?/ig, '' );

// Remove AfC topic template
text = text.replace( /\{\{AfC topic\|(.*?)\}\}\n?/ig, '' );
var templatesToRemove = [
'AfC postpone G13',
'Draft topics',
'AfC topic',
'Drafts moved from mainspace',
'Promising draft'
];

// Remove drafts moved from mainspace template
text = text.replace( /\{\{Drafts moved from mainspace\|(.*?)\}\}\n?/ig, '' );
templatesToRemove.forEach( function ( template ) {
text = text.replace( new RegExp( '\\{\\{' + template + '\\s*\\|?(.*?)\\}\\}\\n?', 'gi' ), '' );
} );

// Add to the list of comments to remove
$.merge( commentsToRemove, [
Expand Down

0 comments on commit b82ad0b

Please sign in to comment.