Module:no head temp

local export = {}

local Array = require "Module:array"

local high_memory_pages = Array("a"):to_set

-- plain byte version of mw.text.lua, -- from https://github.com/wikimedia/mediawiki-extensions-Scribunto/blob/31335/includes/engines/LuaCommon/lualib/mw.text.lua function gsplit(text, pattern, plain) local start_pos, len = 1, #text return function if start_pos then local end_pos, sep_end_pos = text:find(pattern, start_pos, plain) local ret if not end_pos then ret = text:sub(start_pos) start_pos = nil elseif sep_end_pos < end_pos then -- Empty separator! ret = text:sub(start_pos, end_pos) if end_pos < len then start_pos = end_pos + 1 else start_pos = nil end else ret = end_pos > start_pos and text:sub(start_pos, end_pos - 1) or '' start_pos = sep_end_pos + 1 end return ret end end, nil, nil end

local function collect(...) local i = 0 local t = {} for v in ... do		i = i + 1 t[i] = v	end return t end

local function iter_two(t) local iter, t, i = ipairs(t) local done = false return function if not done then local a, b			i, a = iter(t, i)			if i then i, b = iter(t, i)			end if not i then done = true return end return a, b		end end end

function export.show(frame) local tsv = frame.args[1] local output = Array output:insert class="wikitable sortable" ! page !! date !! editor !! latest revision? || language section || example for line in tsv:gmatch "[^\n]+" do		local get_next_field = gsplit(line, "\t", true) local title, user, date, revision, latest = get_next_field, get_next_field, get_next_field, get_next_field, get_next_field local rest = collect(get_next_field) if not high_memory_pages[title] then local error_count = math.max(1, math.floor(#rest / 2)) local row if revision ~= "" then row = ([=[				:format(error_count, title, revision, title, title, error_count, date, date, date:match "^%d+%-%d+%-%d+", error_count, user, user, error_count, latest == "latest" and "yes" or "no")			else				row = ([=[ :format(error_count, title, title, title, error_count, error_count, error_count) end local first_row = true for language, text in iter_two(rest) do				text = mw.text.unstripNoWiki(text):gsub("\\(.)", function(char)					if char == "n" then						return "\n"					elseif char == "t" then						return "\t"					elseif char == "\\" then						return "\\"					end -- else don't change it				end) local cells = language .. " || " .. frame:extensionTag("pre", text) if first_row then row = row .. " || " .. cells else row = row .. "\n|-\n| " .. cells end first_row = false end if first_row then -- no language and text found row = row .. " || ||"			end output:insert(row) end end output:insert "|}" return output:concat "\n" end
 * rowspan="%d" | %s (diff, edit, history)
 * rowspan="%d" data-sort-value="%s" title="%s" | %s
 * rowspan="%d" | %s
 * rowspan="%d" | %s]=])
 * rowspan="%d" | %s]=])
 * rowspan="%d" | %s (edit, history)
 * rowspan="%d" data-sort-value="" title="" |
 * rowspan="%d" |
 * rowspan="%d" |]=])
 * rowspan="%d" |]=])

return export