(markdown: string, key: string, value: string)
| 4817 | } |
| 4818 | |
| 4819 | function replaceFrontMatterValue(markdown: string, key: string, value: string): string { |
| 4820 | const line = `${key}: ${value}`; |
| 4821 | const pattern = new RegExp(`^${key}:\\s*.*$`, "m"); |
| 4822 | if (pattern.test(markdown)) return markdown.replace(pattern, line); |
| 4823 | return markdown.replace(/^---\n/, `---\n${line}\n`); |
| 4824 | } |
| 4825 | |
| 4826 | function sectionValue(markdown: string, heading: string): string { |
| 4827 | const match = markdown.match( |
no outgoing calls
no test coverage detected