Jump to content

Module:Table template counter and Module:Table template counter/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
mNo edit summary
 
Created page with '-- This module counts table rows with specified template name in wikitext. local p = {} local getArgs function p.main(frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return p._main(getArgs(frame, {wrappers = 'Template:Table template counter'})) end function p._main(args) -- Get the title object. local titleObj do local success success, titleObj = pcall(mw.title.new, args.page) if not success or not titleObj then...'
 
Line 65: Line 65:
do
do
local temp
local temp
temp, count = string.lower(wikitable):gsub('|%-[|\n%-:;=\"\'%[%w%s%(%)%]%!]*%{%{'..string.lower(args.templatename)..'|[\'%[%a%s%(%:%-%–%|%d%)%]]+%}%}', '{{'..args.templatename..'}}')
temp, count = wikitable:gsub('|%-[|\n%-:;=\"\'%[%w%s%(%)%]]*%{%{'..args.templatename..'|[\'%[%a%s%(%|%d%)%]]+%}%}', '{{'..args.templatename..'}}')
end
end
end
end