MCPcopy
hub / github.com/inkeep/open-knowledge / parse

Method parse

packages/core/src/markdown/index.ts:120–134  ·  view source on GitHub ↗
(markdown: string, opts?: ParseContext)

Source from the content-addressed store, hash-verified

118 }
119
120 parse(markdown: string, opts?: ParseContext): JSONContent {
121 if (!markdown.trim()) {
122 return {
123 type: 'doc',
124 content: [{ type: 'paragraph', content: [] }],
125 };
126 }
127 this.parseCtx.current = opts ?? {};
128 try {
129 const doc = parseMd(markdown, this.parseProcessor);
130 return doc.toJSON() as JSONContent;
131 } finally {
132 this.parseCtx.current = {};
133 }
134 }
135
136 parseToMdast(markdown: string): MdastRoot {
137 if (!markdown.trim()) {

Callers 15

parseWithFallbackMethod · 0.95
convergeOnTargetFunction · 0.95
maybeFireStuckHintFunction · 0.80
isPathWithinProjectFunction · 0.80
loadAppStateFunction · 0.80
mcp-wiring.test.tsFile · 0.80
dirHasOurStateFunction · 0.80
ipc-log.test.tsFile · 0.80

Calls 1

parseMdFunction · 0.90

Tested by 15

readLockFunction · 0.64
waitForLockFunction · 0.64
makeFakePreparedFunction · 0.64
readPkgFunction · 0.64
collectRuntimeDepsFunction · 0.64
readServerVersionFunction · 0.64
summariesFunction · 0.64
loadSnapshotFunction · 0.64
makeConfigFunction · 0.64
benchmarkBlockCountFunction · 0.64
makeConfigFunction · 0.64