Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Module:Sandbox/Ahecht/wikibase

From Wikipedia, the free encyclopedia
require('strict')
return setmetatable({}, {
	__index = function(t, k)
		local what = mw.wikibase[k]
		if type(what) ~= "function" then
			return what
		end
		return function(frame)
			local fargs = frame.args
			local args = {}
			local str_i = 1
			while fargs['s' .. str_i] do
				args[str_i] = fargs['s' .. str_i]
				str_i = str_i + 1
			end
			for i, v in ipairs(fargs) do
				args[i + str_i - 1] = tonumber(v) or v:gsub("^\\", "", 1)
			end
			return (what(unpack(args)))		-- Outside parens truncate to first result avoiding tail call
		end
	end
})