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.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a229fbb8d9da1709

Jump to content

Module:For each named parameter

Permanently protected module
From Wikipedia, the free encyclopedia

local p = {}

function p.main(frame) 
	local code = mw.text.unstripNoWiki(frame.args.code or frame.args[2])
	local results = {}
	local sep = frame.args[1] or ''
	for key, value in pairs(frame:getParent().args) do
		if type(key) ~= 'number' then
			local actualCode = code:gsub("{{{([^{}|]*)|?[^{}]*}}}", {name = key, value = value})
			local result = frame:getParent():preprocess(actualCode)
			if #result > 0 then
				table.insert(results, result)
			end
		end
	end
	return table.concat(results, sep)
end
return p