MCPcopy Create free account
hub / github.com/UNLINEARITY/Obsidian-CodeSpace / normalizeSourcePathCandidate

Function normalizeSourcePathCandidate

src/code_embed.ts:327–332  ·  view source on GitHub ↗
(rawValue: string, plugin: CodeSpacePlugin)

Source from the content-addressed store, hash-verified

325}
326
327function normalizeSourcePathCandidate(rawValue: string, plugin: CodeSpacePlugin): string {
328 const normalized = normalizePath(rawValue.replace(/\\/g, "/").trim());
329 if (!normalized) return "";
330 const abstractFile = plugin.app.vault.getAbstractFileByPath(normalized);
331 return abstractFile instanceof TFile ? abstractFile.path : "";
332}
333
334function resolveSourcePathFromAncestors(embedEl: HTMLElement, plugin: CodeSpacePlugin): string {
335 for (let current: HTMLElement | null = embedEl; current; current = current.parentElement) {

Callers 1

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected