Module:Good Articles: Difference between revisions

Content deleted Content added
m rm overwrought
Getting there. Couldn't get gsub to swallow a nil or false for parameter 3 though, which is a waste.
Line 2:
 
p.main = function (frame)
local NNN = 2 -- provide counts only over this threshold
local args = require("Module:Arguments").getArgs(frame)
-- expect args.shortcut e.g. GA/H, args.type e.g. History, args.text a long list
Line 14 ⟶ 15:
end
local text = args.text or args[1] or ""
replace = function(t)
local xxxx, links = mw.ustring.gsub(t, "(%[%[[^%[%]]-%]%])", "%1", nil) -- count how many links
if links >= NNN then
t = t .. "<small> (" .. tostring(links) .. "&nbsp;articles)</small>"
end
return t .. "\n"
end
text = mw.ustring.gsub(text, "(==.-)\n%f[=]", replace)
local image = args.image or "error: specify image"
local footer = [===[