Module:Tracked in

-- Utility functions for, which is a template similar to , but lets you link to issues and pull requests that aren't on Phabricator, e.g. GitHub, GitLab, etc.

local p = {}

-- function p.getDomain(frame) local url = frame.args[1] local domain = string.gsub(url, "www%.", "") domain = string.match(domain, 'https?:%/%/(.-)%/.*$') return domain end

-- function p.getIssueNumber(frame) local url = frame.args[1] local issueNumber = string.match(url, '/(%d+)') if tonumber(issueNumber) == nil then return "ERROR: Issue number not found" else return "Issue &#35;" .. issueNumber -- add a # sign in front of the number. can't use #, that creates a numbered list end end

return p