MCPcopy Index your code
hub / github.com/forloopcodes/contextplus / parseWikiLinks

Function parseWikiLinks

src/core/hub.ts:29–42  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

27const HEADER_FEATURE_RE = /^(?:\/\/|#|--)\s*FEATURE:\s*(.+)$/m;
28
29export function parseWikiLinks(content: string): HubLink[] {
30 const links: HubLink[] = [];
31 const seen = new Set<string>();
32 const cleaned = content.replace(CROSS_LINK_RE, "");
33
34 for (const match of cleaned.matchAll(WIKILINK_RE)) {
35 const target = match[1].trim();
36 if (!seen.has(target)) {
37 seen.add(target);
38 links.push({ target, description: match[2]?.trim() });
39 }
40 }
41 return links;
42}
43
44export function parseCrossLinks(content: string, sourceFile: string): CrossLink[] {
45 const crossLinks: CrossLink[] = [];

Callers 3

hub.test.mjsFile · 0.85
parseHubFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected