Anonymous user
Module:Template link general: Difference between revisions
update from sandbox to avoid redundant code
Johnrdorazio (talk | contribs) m (1 revision imported) |
(update from sandbox to avoid redundant code) |
||
Line 98: | Line 98: | ||
-- Build the arguments | -- Build the arguments | ||
local textPart = "" | local textPart = "" | ||
local textPartBuffer = "" | |||
local | local i = 2 | ||
while args[i] do | |||
if val ~= | local val = mw.text.trim(mw.text.unstripNoWiki(args[i])) | ||
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 | |||
end | end | ||
-- final wrap | -- final wrap | ||
local ret = titlePart .. textPart | local ret = titlePart .. textPart |