(label: HTMLElement)
| 12 | import observe from '../helpers/selector-observer.js'; |
| 13 | |
| 14 | function 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 | |
| 26 | function linkify(label: HTMLElement): void { |
| 27 | if (closestElementOptional('a', label)) { |
no test coverage detected