Modul:No ping

Iz Wikipedije, proste enciklopedije
Jump to navigation Jump to search
Documentation icon Dokumentacija modula[predogled] [uredi] [zgodovina] [osveži]

This module implements {{noping}}. Please see the template page for documentation.

-- This module implements {{noping}}.

local p = {}

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

function p._main(args)
	local ret = {}
	local fullUrl = mw.uri.fullUrl
	local format = string.format
	for i, username in ipairs(args) do
		local url = fullUrl( .. ':' .. username)
		url = tostring(url)
		local label = args['label' .. tostring(i)]
		url = format('[%s %s]', url, label or username)
		ret[#ret + 1] = url
	ret = mw.text.listToText(ret)
	ret = '<span class="plainlinks">' .. ret .. '</span>'
	return ret

return p