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

Method formatContentOnly

src/engine/CaptureChoiceEngine.selection.test.ts:56–79  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

54 return await work();
55 }
56 async formatContentOnly(content: string) {
57 if (/\{\{clipboard\}\}/i.test(content)) {
58 createdClipboardAttachmentPaths.push("Clipboard image.png");
59 return content.replace(/\{\{clipboard\}\}/gi, "![[Clipboard image.png]]");
60 }
61
62 if (!/\{\{value\}\}/i.test(content)) return content;
63
64 const draftHandler = new InputPromptDraftHandler(
65 {
66 kind: "single",
67 header: "Capture Choice",
68 placeholder: "",
69 },
70 () => true,
71 );
72 const hydrated = draftHandler.hydrate("");
73 promptHydratedValues.push(hydrated);
74 const submitted = promptResponses.shift() ?? hydrated;
75 draftHandler.markChanged();
76 draftHandler.persist(submitted, true);
77
78 return content.replace(/\{\{value\}\}/gi, submitted);
79 }
80 async formatContentWithFile(content: string) {
81 if (/\{\{clipboard\}\}/i.test(content)) {
82 createdClipboardAttachmentPaths.push("Clipboard image.png");

Callers

nothing calls this directly

Calls 4

hydrateMethod · 0.95
markChangedMethod · 0.95
persistMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected