local p = {}
function p.nav(frame)
local wt_subp = '{| class="wikitable" style="text-align: center;"\n|-\n'..
'| style="text-align: left;" | Subpage:'
local wt_typos = '| style="text-align: left;" | Typos:'
local h2_regex = '[\r\n]==%s*%[%[[^\r\n]+%]%]%s*=='
local i = 0
while i < 20 do
i = i + 1
local ele
local ele_grey = '<span style="color:#888">'..i..'</span>'
local subpi = 'Wikipedia:Correct typos in one click/'..i
local subpi_content = mw.title.new(subpi, 4):getContent() --project space
local dummy, n = mw.ustring.gsub(subpi_content, h2_regex, '%0')
if n > 0 then
ele = '[['..subpi..'|'..i..']]'
else
ele = ele_grey
n = ''
end
wt_subp = wt_subp..'\n| '..ele
wt_typos = wt_typos..'\n| '..n
end
return wt_subp..'\n|-\n'..wt_typos..'\n|}'
end
return p