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

Function getAuthor

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

Source from the content-addressed store, hash-verified

12import observe from '../helpers/selector-observer.js';
13
14function getAuthor(label: HTMLElement): string {
15 const prMetadataRow = closestElementOptional('.opened-by', label);
16 if (!prMetadataRow) {
17 return getCommentAuthor(label);
18 }
19
20 const userPrsLink = $('a[data-hovercard-type="user"]', prMetadataRow);
21 // The link always ends with author
22 const username = userPrsLink.href.split('author%3A', 2)[1];
23 return username;
24}
25
26function linkify(label: HTMLElement): void {
27 if (closestElementOptional('a', label)) {

Callers 1

linkifyFunction · 0.85

Calls 1

getCommentAuthorFunction · 0.85

Tested by

no test coverage detected