Module:Arbitration motion implementation notes/Motion/Automatic and Module:Arbitration motion implementation notes/Motion/Automatic/sandbox: Difference between pages
(Difference between pages)
imported>SilverLocust m Oh yeah that way hadn't worked in Module:Arbitration case implementation notes/Proposal/Automatic |
imported>SilverLocust ipairs to loop over an array |
||
| Line 7: | Line 7: | ||
local page = args["page"] or "" | local page = args["page"] or "" | ||
local section = args["section"] or args["anchor"] or args["name"] or "{{{name}}}" | local section = args["section"] or args["anchor"] or args["name"] or "{{{name}}}" | ||
local pattern = args["pattern"] or "%c:?#[^: | local pattern = args["pattern"] or "%c:?#[^#:]" | ||
local ret = args["ret"] or "" | local ret = args["ret"] or "" | ||
local escape = mw.ustring.gsub( section, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) | local escape = mw.ustring.gsub( section, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" ) | ||
| Line 47: | Line 47: | ||
local abstainText = mw.ustring.gsub(sectionText, ".*;Abstain", "Abstain") | local abstainText = mw.ustring.gsub(sectionText, ".*;Abstain", "Abstain") | ||
local _, abstain = mw.ustring.gsub(abstainText, pattern, "") | local _, abstain = mw.ustring.gsub(abstainText, pattern, "") | ||
if matches ~= 1 then | if matches ~= 1 then | ||
| Line 64: | Line 60: | ||
..']] with heading<br><code>' | ..']] with heading<br><code>' | ||
..tostring(section) | ..tostring(section) | ||
..'</code> | ..'</code></span></td></tr><tr style="display:none">' | ||
end | end | ||