MCPcopy
hub / github.com/refined-github/refined-github / alterLink

Function alterLink

source/features/linkify-pr-review-state.tsx:23–39  ·  view source on GitHub ↗
(label: HTMLElement)

Source from the content-addressed store, hash-verified

21]);
22
23function alterLink(label: HTMLElement): void {
24 for (const [text, filter] of reviewStateFilters) {
25 // Use .textContent because "Draft" lacks any unique attributes
26 if (label.textContent.trim() !== text) {
27 continue;
28 }
29
30 const url = new SearchQuery(buildRepoUrl('pulls')).append(filter).href;
31 if (label instanceof HTMLAnchorElement) {
32 label.href = url;
33 continue;
34 }
35
36 wrap(label, <a href={url} />);
37 $('[class*="statusText"]', label).classList.add('Link--onHover');
38 }
39}
40
41function init(signal: AbortSignal): void {
42 observe(

Callers

nothing calls this directly

Calls 3

buildRepoUrlFunction · 0.85
wrapFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected