Module:Lorem ipsum: Difference between revisions

m 1 revision imported
enwiki>Awesome Aasim
No edit summary
Line 48: Line 48:
local link = yn(args["link"])
local link = yn(args["link"])
local paragraph = paragraphs[math.mod(i - 1, #paragraphs) + 1]
local paragraph = paragraphs[math.mod(i - 1, #paragraphs) + 1]
local maxLen = tonumber(args["max len"] or mw.ustring.len(paragraph))
local out = ""
local out = ""
if cat and mw.title.getCurrentTitle().namespace == 0 and not mw.isSubsting() then
if cat and mw.title.getCurrentTitle().namespace == 0 and not mw.isSubsting() then
out = out .. "[[Category:Wikipedia articles containing placeholders]]"
out = out .. "[[Category:Wikipedia articles containing placeholders]]"
end
end
out = out .. mw.ustring.format(mw.ustring.sub(paragraph, 1, maxLen), (link and "link" or ""))
out = out .. mw.ustring.format(paragraph, (link and "link" or ""))
return frame:preprocess(out)
out = frame:preprocess(out)
local maxLen = tonumber(args["max len"] or mw.ustring.len(out))
return mw.ustring.sub(out, 1, maxLen)
end
end
}
}