Extract unique owner/repo pairs from GitHub URLs in markdown text.
(text: str)
| 27 | |
| 28 | |
| 29 | def extract_github_repos(text: str) -> set[str]: |
| 30 | """Extract unique owner/repo pairs from GitHub URLs in markdown text.""" |
| 31 | repos = set() |
| 32 | for url in re.findall(r"https?://github\.com/[^\s)\]]+", text): |
| 33 | repo = extract_github_repo(url.split("#")[0].rstrip("/")) |
| 34 | if repo: |
| 35 | repos.add(repo) |
| 36 | return repos |
| 37 | |
| 38 | |
| 39 | def save_cache(cache: dict) -> None: |