Skip to content

Commit

Permalink
xfd: refactor regex to use mw.Title (wikimedia-gadgets#2054)
Browse files Browse the repository at this point in the history
  • Loading branch information
NovemLinguae authored and rustykitty committed Dec 1, 2024
1 parent 8ca0abf commit 2abc72e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions modules/twinklexfd.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,9 +728,7 @@ Twinkle.xfd.callback.change_category = function twinklexfdCallbackChangeCategory
work_area = work_area.render();
old_area.parentNode.replaceChild(work_area, old_area);

const currentNonTalkPage = Morebits.pageNameNorm
.replace(/^Talk:/, '')
.replace(/^([A-Za-z]*) talk:/, '$1:');
const currentNonTalkPage = mw.Title.newFromText(Morebits.pageNameNorm).getSubjectPage().toText();
form.currentname.value = currentNonTalkPage;
break;
}
Expand Down

0 comments on commit 2abc72e

Please sign in to comment.