Module:Template link general: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(remove parameter limit)
interwikiprefix>Primefac
(update code - remove trailing blank parameters)
Line 98: Line 98:
-- Build the arguments
-- Build the arguments
local textPart = ""
local textPart = ""
local textPartBuffer = ""
local i = 2
local i = 2
while args[i] do
while args[i] do
local val = args[i]
local val = args[i]
if val ~= nil then val = mw.text.unstripNoWiki(val) else break end
if val ~= nil then val = mw.text.unstripNoWiki(val) else break end
textPartBuffer = textPartBuffer .. '|'
if _ne(args.nowiki) then val = nw(val) end
if val ~= "" then
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
if _ne(args.nowiki) then val = nw(val) end
textPart = textPart .. '&#124;' .. val
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
textPart = textPart .. textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
i = i+1
end
end

-- final wrap
-- final wrap
local ret = titlePart .. textPart
local ret = titlePart .. textPart