MCPcopy Create free account
hub / github.com/Qinbf/groundmap / normalizeRefPath

Function normalizeRefPath

tools/debug-console/lib/wiki-ref.ts:102–106  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

100
101/** 规范化路径——补 .md 后缀(如果没有),统一斜杠 */
102export function normalizeRefPath(raw: string): string {
103 const p = raw.trim().replace(/\\/g, "/").replace(/^\/+/, "");
104 if (/\.(md|html|pdf|txt|outline\.json)$/i.test(p)) return p;
105 return `${p}.md`;
106}
107
108export function parseWikiRef(target: string, anchor?: string, alias?: string): WikiRef {
109 let normAnchor: string | null = null;

Callers 1

parseWikiRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected