mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
First user message is always interpreted as plain text
This commit is contained in:
3 files changed
+7
-163
No files matched your search
@@ -20,9 +20,15 @@ export function UserMessage({ content }: UserMessageProps) {
|
||||
// Process each content part and categorize as text or file
|
||||
const processedParts: Array<{ type: 'text' | 'file'; content: string; filepath?: string }> = [];
|
||||
|
||||
contentParts.forEach(part => {
|
||||
contentParts.forEach((part, index) => {
|
||||
const text = part.text.trim();
|
||||
|
||||
// First content part is always treated as text
|
||||
if (index === 0) {
|
||||
processedParts.push({ type: 'text', content: text });
|
||||
return;
|
||||
}
|
||||
|
||||
// Matches the pattern anywhere in the text
|
||||
// Regular expression to match "Added file: <filename>" patterns
|
||||
const filePattern = /^Added file: (\/[^\s\n]+$)/g;
|
||||
|
||||
Reference in new issue
Block a user