MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / splitLinkTarget

Function splitLinkTarget

src/pages/markdownPreview/renderer.js:39–49  ·  view source on GitHub ↗
(target = "")

Source from the content-addressed store, hash-verified

37}
38
39function splitLinkTarget(target = "") {
40 const hashIndex = target.indexOf("#");
41 if (hashIndex === -1) {
42 return { path: target, hash: "" };
43 }
44
45 return {
46 path: target.slice(0, hashIndex),
47 hash: target.slice(hashIndex),
48 };
49}
50
51export function isExternalLink(target = "") {
52 return EXTERNAL_LINK_PATTERN.test(String(target).trim());

Callers 2

resolveMarkdownTargetFunction · 0.85
resolveImageTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected