Module:Autonumber

local p = {}

function p.main(frame) local args = frame.args local pos = {1} local count = 0 local i = 1 while args[i] ~= nil do		pos[i] = string.find(args[i], "#", (pos[i] or 1)+1) if string.find(args[i], "#") then count = count + 1 end args[i] = string.gsub(args[i], "#", count, 1) i = i + 1 end table.insert(args, 2, "class=" .. args.class .. "\n") return table.concat(args, "|") end

return p