跳转到内容

模組:Look from

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由SunAfterRain留言 | 贡献2019年11月24日 (日) 13:36编辑。这可能和当前版本存在着巨大的差异。

local p={}

function p._main(args, frame)
	local title = args['1'] or tostring(mw.title.getCurrentTitle())
	local ns = args['2'] or ''
	local title_ns = frame:callParserFunction{name = "NAMESPACE", args = title}
	local page = frame:callParserFunction{name = "PAGENAME", args = title}
	if ((title_ns == '') == 0) and ((ns == '') == 0) then
		title = ns .. ':' .. page
	else
		ns = title_ns
	end
	local text = args['3'] or '以「-{' ..title ..'}-」開頭的' .. frame:expandTemplate{title = "NS1", args = {["2"]=ns}}
	return '<span class="selfreference">[[Special:PrefixIndex/' .. title .. '|' .. text .. ']]</span>'
end

function p.main(frame)
	local args = frame:getParent().args
	return p._main(args, frame)
end

return p