MCPcopy
hub / github.com/Narcooo/inkos / firstParagraph

Function firstParagraph

packages/studio/src/lib/truth-display.ts:89–96  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

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.
89export 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
98export interface RoleRef {
99 readonly path: string;

Callers 2

SummarySectionFunction · 0.90

Calls 2

stripStructuralMarkersFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected