MCPcopy Create free account
hub / github.com/anus-dev/ANUS / findMarkdownComments

Function findMarkdownComments

packages/core/src/utils/memoryImportProcessor.test.ts:44–62  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

42const parseMarkdown = (content: string) => marked.lexer(content);
43
44const findMarkdownComments = (content: string): string[] => {
45 const tokens = parseMarkdown(content);
46 const comments: string[] = [];
47
48 function walkTokens(tokenList: unknown[]) {
49 for (const token of tokenList) {
50 const t = token as { type: string; raw: string; tokens?: unknown[] };
51 if (t.type === 'html' && t.raw.includes('<!--')) {
52 comments.push(t.raw.trim());
53 }
54 if (t.tokens) {
55 walkTokens(t.tokens);
56 }
57 }
58 }
59
60 walkTokens(tokens);
61 return comments;
62};
63
64const findCodeBlocks = (
65 content: string,

Callers 1

Calls 2

parseMarkdownFunction · 0.85
walkTokensFunction · 0.85

Tested by

no test coverage detected