From 207b70fb42c8999adf38910f6ecfd0fd2e13a9b3 Mon Sep 17 00:00:00 2001 From: CHAU SHING SHING HAMISH Date: Thu, 24 Oct 2024 13:44:12 +0800 Subject: [PATCH] close: wrap new delete template w/ noinclude --- modules/twinkleclose.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/twinkleclose.js b/modules/twinkleclose.js index dd130153..b21d27e4 100644 --- a/modules/twinkleclose.js +++ b/modules/twinkleclose.js @@ -826,8 +826,10 @@ Twinkle.close.callbacks = { Morebits.status.warn(conv({ hans: '重新标记', hant: '重新標記' }), conv({ hans: '找不到提删模板,重新插入', hant: '找不到提刪模板,重新插入' })); // Insert tag after short description or any hatnotes var wikipage = new Morebits.wikitext.page(text); - // TODO: can we add reason here? var tag = '{{vfd|date=' + params.date + '}}\n'; + if (pageobj.getPageName().substring(0, 9) === 'Template:') { + tag = '' + tag + ''; + } text = wikipage.insertAfterTemplates(tag, Twinkle.hatnoteRegex).getText(); }