diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx index 84193d7a38..fa83fac679 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/copilot/components/copilot-modal/copilot-modal.tsx @@ -80,7 +80,8 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) { // Handle lists processedText = processedText.replace(/^- (.*$)/gm, '
')
processedText = processedText.replace(/\n/g, '
')
return processedText
@@ -109,8 +110,8 @@ function ModalCopilotMessage({ message }: CopilotModalMessage) {
')
- .replace(/\n/g, '
')
+ // Handle line breaks (reduce spacing)
+ .replace(/\n\n+/g, '
')
+ .replace(/\n/g, '
')
- // Wrap in paragraph tags if not already wrapped
- if (
- !processedContent.includes('
') && - !processedContent.includes('
${processedContent}
` - } + // Wrap in paragraph tags if not already wrapped + if ( + !processedContent.includes('') && + !processedContent.includes('
${processedContent}
` + } return processedContent } @@ -329,14 +329,14 @@ export const Copilot = forwardRef