MCPcopy Create free account
hub / github.com/TeleBoxOrg/TeleBox_Plugins / splitMarkdownSections

Function splitMarkdownSections

deepwiki/deepwiki.ts:528–531  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

526};
527
528const splitMarkdownSections = (text: string): string[] => {
529 const sections = text.split(/\n(?=#+\s)/).map((s) => s.trim()).filter(Boolean);
530 return sections.length ? sections : [text.trim()];
531};
532
533const truncateBySections = (text: string, maxLen: number): { text: string; dropped: number } => {
534 if (text.length <= maxLen) return { text, dropped: 0 };

Callers 1

truncateBySectionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected