Skip to content

Commit

Permalink
fix regex
Browse files Browse the repository at this point in the history
fix regex to avoid matching {{Copy to Wikimedia Commons in}}
  • Loading branch information
DreamRimmer authored Jan 21, 2025
1 parent bbc0309 commit 65ac30b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/twinklespeedy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ Twinkle.speedy.callbacks = {
text = text.replace(/\{\{\s*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, '');
if (mw.config.get('wgNamespaceNumber') === 6) {
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, '');
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)(?!( in))\}\}/gi, '');
}

if (params.requestsalt) {
Expand Down

0 comments on commit 65ac30b

Please sign in to comment.