(text: string)
| 87 | // First non-empty prose paragraph of a body, for an at-a-glance overview. A |
| 88 | // leading markdown heading on the paragraph is dropped so the glance is prose. |
| 89 | export function firstParagraph(text: string): string { |
| 90 | const stripped = stripStructuralMarkers(text); |
| 91 | for (const chunk of stripped.split(/\n{2,}/)) { |
| 92 | const withoutHeading = chunk.replace(/^\s*#{1,6}\s+[^\n]*\n?/, "").trim(); |
| 93 | if (withoutHeading) return withoutHeading; |
| 94 | } |
| 95 | return ""; |
| 96 | } |
| 97 | |
| 98 | export interface RoleRef { |
| 99 | readonly path: string; |
no test coverage detected