(firstCommitTitle: HTMLElement)
| 8 | import observe from '../helpers/selector-observer.js'; |
| 9 | |
| 10 | function getFirstCommit(firstCommitTitle: HTMLElement): {title: string; body: string | undefined} { |
| 11 | // Commits might not have a body |
| 12 | const body = $optional('.Details-content--hidden pre', firstCommitTitle.parentElement!) |
| 13 | ?.textContent |
| 14 | .trim() ?? undefined; |
| 15 | |
| 16 | const title = parseRenderedText(firstCommitTitle); |
| 17 | |
| 18 | return {title, body}; |
| 19 | } |
| 20 | |
| 21 | function useCommitTitle(firstCommitTitle: HTMLElement): void { |
| 22 | const requestedContent = new URL(location.href).searchParams; |
no test coverage detected