Module:Template link general: Difference between revisions

Content deleted Content added
m 1 revision imported
update from sandbox to avoid redundant code
Line 98:
-- Build the arguments
local textPart = ""
local textPartBuffer = ""
for i = 2, 11 do
local iii = tostring(i)2
local val = while args[iii] do
if val ~= nil thenlocal val = mw.text.trim(mw.text.unstripNoWiki(valargs[i])) 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 .. '&#124;'textPartBuffer .. val
textPartBuffer = ""
end
i = i+1
end
 
if _ne(args['12']) then textPart = textPart .. '&#124;…' end
-- final wrap
local ret = titlePart .. textPart