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

Jump to content

Module:Gerrit

From Wikipedia, the free encyclopedia

local p = {}

p.link = function (frame)
	local hash = frame.args[1]
	local length = string.len(hash)
	
	if not string.match(hash, '^I?%x+$' ) then
		return hash
	end
	local text
	if length > 14 then
		text = string.format("%.7s", hash)
	else
		text = hash
	end
	
	local url
	if length > 6 then
		-- query
		url = 'https://gerrit.wikimedia.org/r/q/' .. mw.uri.encode(hash)
    else
    	-- probably a change
    	url = 'https://gerrit.wikimedia.org/r/c/' .. hash .. '/'
    end
        	
    return '<span class=plainlinks style="font-family: Consolas, Liberation Mono, Courier, monospace; text-decoration: none;">[' .. url .. ' ' .. text .. ']</span>'
end
return p