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: a2256bd1df677089

Jump to content

Module:Redirect-distinguish-for

From Wikipedia, the free encyclopedia

mArguments = require('Module:Arguments')
mRedirectHatnote = require("Module:Redirect hatnote")

local p = {}

function p.redirectDistinguishFor(frame)
	local args = mArguments.getArgs(frame, {parentOnly = true})
	local maxArg = 0
	for k, v in pairs(args) do
		if type(k) == 'number' and k > maxArg then maxArg = k end
	end
	local parsedArgs = {}
	for i = 1, maxArg do
		if i ~= 2 then
			parsedArgs[i == 1 and 1 or i - 1] = args[i] end
	end
	return (string.gsub( --Note that the outer parentheses are necessary!
		mRedirectHatnote._redirect(parsedArgs, 1, {selfref = args.selfref}),
		"(redirects? here.)",
		"%1 Not to be confused with [[:" .. (args[2]:match('^:?(.*)')) .. "]].",
		1
	))
end

return p