Module:Gerrit

local UrlEncoding = require( 'Module:UrlEncoding' )

return { link_automatic = function ( frame ) local suspect, changenum_match, changeid_match, retval suspect = frame.args[1] changenum_match = string.match( suspect, '%d+' ) changeid_match = string.match( suspect, 'I%x+' ) retval = '[[:gerrit:'

if changeid_match ~= nil then retval = retval .. '#q,' .. changeid_match .. ',n,z|Gerrit ' .. string.sub( changeid_match, 0, 7 ) elseif changenum_match ~= nil then retval = retval .. changenum_match .. '|Gerrit change' .. changenum_match end

retval = retval .. ']]'

return retval end }