(markdown: string)
| 37 | } |
| 38 | |
| 39 | export function parseFrontMatter(markdown: string) { |
| 40 | const match = markdown.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/); |
| 41 | if (!match) { |
| 42 | return { frontMatter: null, content: markdown }; |
| 43 | } |
| 44 | |
| 45 | return { |
| 46 | frontMatter: match[1], |
| 47 | content: match[2], |
| 48 | }; |
| 49 | } |
| 50 | |
| 51 | const DOCS_URL_PATTERN = |
| 52 | /^\s*#\s*docs:\s*(https?:\/\/github\.com\/NomicFoundation\/hardhat-website\/pull\/\d+)/i; |
no outgoing calls
no test coverage detected