MCPcopy Index your code
hub / github.com/refined-github/refined-github / linkify

Function linkify

source/features/linkify-user-labels.tsx:26–38  ·  view source on GitHub ↗
(label: HTMLElement)

Source from the content-addressed store, hash-verified

24}
25
26function linkify(label: HTMLElement): void {
27 if (closestElementOptional('a', label)) {
28 throw new Error('Already linkified, feature needs to be updated');
29 }
30
31 // React might create a new label without removing the old one
32 // https://github.com/refined-github/refined-github/issues/8478
33 $optional('.rgh-linkify-user-labels', label.parentElement!)?.remove();
34
35 const url = new URL(buildRepoUrl('commits'));
36 url.searchParams.set('author', getAuthor(label));
37 wrap(label, <a className="Link--onHover no-underline color-fg-inherit rgh-linkify-user-labels" href={url.href} />);
38}
39
40const ariaLabelSelector = is(
41 '[aria-label^="This user is a member"]',

Callers

nothing calls this directly

Calls 5

buildRepoUrlFunction · 0.85
getAuthorFunction · 0.85
wrapFunction · 0.85
removeMethod · 0.80
setMethod · 0.80

Tested by

no test coverage detected