local ask = mw.smw.ask
return {
['drillable count'] = function (frame)
-- We need a clone of frame.args:
local args = {}
for no, value in ipairs (frame.args) do
args [no] = value
end
for arg, value in pairs (frame.args) do
if type (arg) ~= 'number' then
args [arg] = value
end
end
local format = args.format
args.format = 'count'
local number = ask (args)
local link = ''
if number > 0 then
args.format = format
args.limit = 0
args.searchlabel = tostring (number)
link = frame:callParserFunction ('#ask', args )
end
return link
end
}