| 1 | const REPOSITORY = "https://github.com/Hmbown/CodeWhale"; |
| 2 | |
| 3 | export function faqSourceHref(source: string): string | null { |
| 4 | const issue = source.match(/^#(\d+)$/); |
| 5 | if (issue) return `${REPOSITORY}/issues/${issue[1]}`; |
| 6 | if (source.endsWith(".md") || source.includes("/")) { |
| 7 | return `${REPOSITORY}/blob/main/${source}`; |
| 8 | } |
| 9 | return null; |
| 10 | } |
| 11 |