Module:Link:修订间差异

来自Arcaea中文维基
无编辑摘要
无编辑摘要
第8行: 第8行:
end
end
return result
return result
end
function link(page,name)
return '[['..page..'列表#'..name..'|'..name..']]'
end
end


function p.link(frame)
function p.link(frame)
 
local page,text=mw.getCurrentFrame():getParent().args[1],mw.getCurrentFrame():getParent().args[2]
local a,b,c = text
:match('(.*?) (vs) (.*?)')
:match('(.*?) (vs.) (.*?)')
if a and b and c then
return link(a)..b..link(c)
end
end
end


return p
return p

2021年5月11日 (二) 22:14的版本

可在Module:Link/doc创建此模块的帮助文档

local p = {}

function p.titular(frame)
	local result=""
	args=mw.getCurrentFrame():getParent().args
	for i,k in ipairs(args) do
		result=result..'<span id="'..k..'"></span>'
	end
	return result
end

function link(page,name)
	return '[['..page..'列表#'..name..'|'..name..']]'
end

function p.link(frame)
	local page,text=mw.getCurrentFrame():getParent().args[1],mw.getCurrentFrame():getParent().args[2]
	local a,b,c = text
				:match('(.*?) (vs) (.*?)')
				:match('(.*?) (vs.) (.*?)')
	if a and b and c then
		return link(a)..b..link(c)
	end
end

return p