跳转到内容

模組:Link with book title mark

维基百科,自由的百科全书
local z={}
	function z.main(frame)
	    if frame.args.parent then
	        args = frame:getParent().args
	    else
	        args = frame.args
	    end
		local a = args[1]
		local b = args[2]
		local result

		if a == nil then
			return ''
		end
		
		if b == nil then
			b = a
		elseif b == '' then
			b = frame:preprocess('{{PAGENAME:' .. a .. '}}')
		end
		
		b = b:gsub("《", "〈"):gsub("》", "〉")
		return '《[[:' .. a .. '|' .. b .. ']]》'
	end
return z