(file, text)
| 48 | |
| 49 | // Internal links. |
| 50 | function getLinks(file, text) { |
| 51 | const links = []; |
| 52 | for (const match of text.matchAll(/\[[^\]]+\]\(([^)]+)\)/g)) { |
| 53 | const [, link] = match; |
| 54 | if (/^\w+:/.test(link)) continue; // absolute link with protocol |
| 55 | const {pathname, hash} = new URL(link, new URL(file, "https://example.com/")); |
| 56 | links.push({pathname, hash}); |
| 57 | } |
| 58 | return links; |
| 59 | } |
| 60 | |
| 61 | // In source files, ignore comments. |
| 62 | async function readMarkdownSource(f) { |
no outgoing calls
no test coverage detected
searching dependent graphs…