@@ -18,11 +18,11 @@ export interface Toast { id: number; title: string; ref?: string }
|
||||
|
||||
/** Build the exact text inserted into the agent for a "Pass on …" action.
|
||||
* - Plain reference / name → `note => thing` (or just `thing` with no note).
|
||||
* - Selected code → `note [ref](ref)` followed by the code in a fenced block. */
|
||||
* - Selected code → `note ref` followed by the code in a fenced block. */
|
||||
export function buildPass(note: string, ref: string, code?: string): string {
|
||||
const n = note.trim()
|
||||
if (code != null) {
|
||||
const head = (n ? n + ' ' : '') + `[${ref}](${ref})`
|
||||
const head = (n ? n + ' ' : '') + ref
|
||||
return head + '\n```\n' + code + '\n```'
|
||||
}
|
||||
return n ? `${n} => ${ref}` : ref
|
||||
|
||||
Reference in New Issue
Block a user