From 45d35a8247918f4c571078d1d5d6c972b3af3d8f Mon Sep 17 00:00:00 2001 From: "Charl P. Botha" Date: Sat, 31 May 2025 21:27:47 +0200 Subject: [PATCH] Remove whitespace before first citation --- src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index a242e74..867ca4d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -235,10 +235,9 @@ class PerplexityServer { // response.data can have a string[] .citations // these are referred to in the return text as numbered citations e.g. [1] const sourcesText = response.data.citations - ? `\n## Sources\nPlease keep the numbered citations inline.\n - ${response.data.citations - .map((c: string, i: number) => `${i + 1}: ${c}`) - .join("\n")}` + ? `\n\n## Sources\nPlease keep the numbered citations inline.\n${response.data.citations + .map((c: string, i: number) => `${i + 1}: ${c}`) + .join("\n")}` : ""; return {