Module:Lorem ipsum: Difference between revisions
EnWikiAdmin (talk | contribs) m 1 revision imported |
EnWikiAdmin (talk | contribs) m 1 revision imported |
||
(One intermediate revision by one other user not shown) | |||
Line 11: | Line 11: | ||
local link = yn(args["link"]) or yn(args[4]) or false | local link = yn(args["link"]) or yn(args[4]) or false | ||
local join = yn(args["join"]) or false | local join = yn(args["join"]) or false | ||
local joinprefixsuffix = yn(args["joinprefixsuffix"]) or false | |||
local cat = yn(args["cat"]) or true | local cat = yn(args["cat"]) or true | ||
local count = tonumber(args[1] or 1) | local count = tonumber(args[1] or 1) | ||
local i = 1 | local i = 1 | ||
if join then | if join and (not joinprefixsuffix) then | ||
out = out .. (args["prefix"] or args[2] or "") | out = out .. (args["prefix"] or args[2] or "") | ||
end | end | ||
while i <= count do | while i <= count do | ||
if not join then | if (not join) or joinprefixsuffix then | ||
out = out .. (args["prefix"] or args[2] or "\n") | out = out .. (args["prefix"] or args[2] or "\n") | ||
end | end | ||
Line 25: | Line 26: | ||
out = out .. (args["suffix"] or args[3] or "") .. "\n" | out = out .. (args["suffix"] or args[3] or "") .. "\n" | ||
else | else | ||
if joinprefixsuffix then | |||
out = out .. (args["suffix"] or args[3] or "") | |||
end | |||
out = out .. (i == count and "" or " ") | out = out .. (i == count and "" or " ") | ||
end | end | ||
Line 30: | Line 34: | ||
i = i + 1 | i = i + 1 | ||
end | end | ||
if join then | if join and (not joinprefixsuffix) then | ||
out = out .. (args["suffix"] or args[3] or "") | out = out .. (args["suffix"] or args[3] or "") | ||
end | end |