(key: 'title' | 'description')
| 232 | |
| 233 | const frontmatter = match[1] |
| 234 | const getValue = (key: 'title' | 'description') => { |
| 235 | const valueMatch = frontmatter.match( |
| 236 | new RegExp(`^${key}:\\s*(?:"([^"]*)"|'([^']*)'|(.+))\\s*$`, 'm'), |
| 237 | ) |
| 238 | return normalizeText( |
| 239 | decodeHtmlEntities( |
| 240 | valueMatch?.[1] ?? valueMatch?.[2] ?? valueMatch?.[3] ?? '', |
| 241 | ), |
| 242 | ) |
| 243 | } |
| 244 | |
| 245 | return { |
| 246 | title: getValue('title') || undefined, |
no test coverage detected