Module:Sandbox/Dat Hack3r: Difference between revisions
Appearance
Dat Hack3r (talk | contribs) Fixed "string expected, got table" when using a title object. |
Dat Hack3r (talk | contribs) Fixed overly-limited scope of "curr_num". |
||
Line 7: | Line 7: | ||
title_format = title_format or string.gsub(title.text, '%d+', '%%d', 1) | title_format = title_format or string.gsub(title.text, '%d+', '%%d', 1) | ||
text_format = text_format or '%d' | text_format = text_format or '%d' | ||
local curr_num | |||
if title_format then | if title_format then | ||
curr_num = tonumber(string.match(title.text, string.gsub(title_format, "%%d", "(%%d+)"))) | |||
else | else | ||
curr_num = tonumber(string.match(title.text, '%d+')) | |||
end | end | ||