Module:Row numbers: Difference between revisions

From escforumwiki
Jump to navigation Jump to search
en>Trappist the monk
(create;)
 
en>Trappist the monk
No edit summary
Line 1: Line 1:
p={}
p={}
function p.incrementor (frame)
function p.incrementor (frame)
local tbl_str = frame.args[1];
local tbl_str = mw.text.unstripNoWiki (frame.args[1]);
local count = 1;
local count = 1;
while (tbl_str:find ('row_count')) do
while (tbl_str:find ('row_count')) do
tbl = tbl_str:gsub ('row_count', count, 1);
tbl_str = tbl_str:gsub ('row_count', count, 1);
count = count + 1;
count = count + 1;
end
end

Revision as of 15:49, 10 April 2018

Implements {{Row numbers}}


p={}
function p.incrementor (frame)
	local tbl_str = mw.text.unstripNoWiki (frame.args[1]);
	local count = 1;
	
	while (tbl_str:find ('row_count')) do
		tbl_str = tbl_str:gsub ('row_count', count, 1);
		count = count + 1;
	end
	return frame:preprocess (tbl_str);

end

return p;