Module:Template link general: Difference between revisions
update code - remove trailing blank parameters
(remove parameter limit) |
(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 | ||
if _ne(args.nowiki) then val = nw(val) end | textPartBuffer = textPartBuffer .. '|' | ||
if val ~= "" then | |||
if _ne(args.nowiki) then val = nw(val) end | |||
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 |