Skip to content

Commit 65ac30b

Browse files
authored
fix regex
fix regex to avoid matching {{Copy to Wikimedia Commons in}}
1 parent bbc0309 commit 65ac30b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: modules/twinklespeedy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ Twinkle.speedy.callbacks = {
14081408
text = text.replace(/\{\{\s*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g, '');
14091409
if (mw.config.get('wgNamespaceNumber') === 6) {
14101410
// remove "move to Commons" tag - deletion-tagged files cannot be moved to Commons
1411-
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi, '');
1411+
text = text.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)(?!( in))\}\}/gi, '');
14121412
}
14131413

14141414
if (params.requestsalt) {

0 commit comments

Comments
 (0)