(label: HTMLElement)
| 24 | } |
| 25 | |
| 26 | function 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 | |
| 40 | const ariaLabelSelector = is( |
| 41 | '[aria-label^="This user is a member"]', |
nothing calls this directly
no test coverage detected