MCPcopy Create free account
hub / github.com/chhoumann/quickadd / formatFileContent

Method formatFileContent

src/formatters/completeFormatter.ts:132–148  ·  view source on GitHub ↗
(input: string)

Source from the content-addressed store, hash-verified

130 }
131
132 async formatFileContent(input: string): Promise<string> {
133 let output: string = input;
134
135 output = await this.format(output);
136 // Resolve ALL note-derived tokens ({{linkcurrent}}, {{linksection}},
137 // {{filenamecurrent}}, {{folder}}, {{title}}) in ONE pass so no token
138 // re-scans another's generated output — fixing both the cross-pass
139 // corruption and the infinite loop a token-named file/title caused (#1358).
140 output = this.replaceCurrentFileTokensInString(output, {
141 links: true,
142 fileName: true,
143 folder: true,
144 title: true,
145 });
146
147 return output;
148 }
149
150 async formatFolderPath(folderName: string): Promise<string> {
151 // Check for {{title}} usage in folder path which would cause issues

Calls 1

formatMethod · 0.95

Tested by 1

mockTemplateVaultFunction · 0.36