diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx index d263e65526..e9e536e000 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/copilot.tsx @@ -205,21 +205,21 @@ export const Copilot = forwardRef(({ panelWidth }, ref return date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }) } - // Function to render content with inline hyperlinked citations and basic markdown + // Function to render content with inline hyperlinked citations and basic markdown const renderContentWithCitations = (content: string, sources: Message['sources'] = []) => { if (!content) return content - + let processedContent = content - + // Replace {cite:1}, {cite:2}, etc. with clickable citation icons processedContent = processedContent.replace(/\{cite:(\d+)\}/g, (match, num) => { const sourceIndex = Number.parseInt(num) - 1 const source = sources[sourceIndex] - + if (source) { return `↗` } - + return match })