Content deleted Content added
fix bug for usernames containing magic characters |
avoid defining ten different output functions by using a metatable; and use string.match rather than mw.ustring.match as it works for this pattern, and it is faster |
||
Line 7:
username = username:gsub('%p', '%%%0')
local r = {}
r.rank, r.uses, r.vand, r.agf, r.queue, r.first, r.last, r.avg, r.yest, r.last30 =
lbtext,
'\n| align=center | (%d+) || align=left | %[%[User:' .. username .. '|' .. username
Line 19:
end
-- Expose the data values to wikitext
return setmetatable({}, {
__index
return function (frame)
local username = frame.args[1] or ''
username = mw.getContentLanguage():ucfirst(mw.text.trim(username))
if username == '' then
error('No username specified')
end
end
▲ return findLeaderboardData(dfield, username)
end
})▼
▲}
|