MCPcopy
hub / github.com/agent0ai/agent-zero / resolveDocumentRelativePath

Function resolveDocumentRelativePath

plugins/_editor/webui/editor-preview.js:95–101  ·  view source on GitHub ↗
(documentPath = "", target = "")

Source from the content-addressed store, hash-verified

93}
94
95export function resolveDocumentRelativePath(documentPath = "", target = "") {
96 const value = String(target || "").trim();
97 if (!value) return "";
98 if (value.startsWith("/")) return normalizePath(value);
99 const base = parentPath(documentPath);
100 return normalizePath(`${base}/${value}`);
101}
102
103export function splitHref(href = "") {
104 const value = String(href || "").trim();

Callers 2

enhanceImagesFunction · 0.90
enhanceLinksFunction · 0.90

Calls 2

normalizePathFunction · 0.70
parentPathFunction · 0.70

Tested by

no test coverage detected