MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / parseLinktext

Function parseLinktext

tests/__mocks__/obsidian.ts:1053–1068  ·  view source on GitHub ↗
(linktext: string)

Source from the content-addressed store, hash-verified

1051
1052// Mock parseLinktext function based on official Obsidian API
1053export function parseLinktext(linktext: string): { path: string; subpath: string } {
1054 // Handle subpath syntax: [[path#subpath]]
1055 const hashIndex = linktext.indexOf('#');
1056 if (hashIndex !== -1) {
1057 return {
1058 path: linktext.slice(0, hashIndex).trim(),
1059 subpath: linktext.slice(hashIndex + 1).trim()
1060 };
1061 }
1062
1063 // Simple path: [[path]]
1064 return {
1065 path: linktext.trim(),
1066 subpath: ''
1067 };
1068}
1069
1070// Icon utilities
1071export function setIcon(element: HTMLElement, iconName: string): void {

Callers 8

resolveDependencyEntryFunction · 0.90
extractWikilinkPathMethod · 0.90
parseWikilinkMethod · 0.90
parseMarkdownLinkMethod · 0.90
parseWikilinkSyncFunction · 0.90
parseMarkdownLinkSyncFunction · 0.90
parseWikiLinkSegmentFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected