Spaces:
Runtime error
Runtime error
refactor: Accumulate raw diff response instead of processing
Browse files134 unmodified lines135136137138139140141142143144145146134 unmodified linesif (responseType === 'diff') {// --- Diff Mode ---currentDiffBuffer += chunk;const remaining = processDiffBuffer(currentDiffBuffer, editorRef.current);currentDiffBuffer = remaining; // Update local buffer with unprocessed part} else {// --- Full HTML Mode ---fullContentResponse += chunk;// Use regex to find the start of the HTML docconst newHtmlMatch = fullContentResponse.match(/<!DOCTYPE html>[\s\S]*/);const newHtml = newHtmlMatch ? newHtmlMatch[0] : null;134 unmodified lines135136137138139140141142143144134 unmodified linesif (responseType === 'diff') {// --- Diff Mode ---accumulatedDiffResponse += chunk; // Just accumulate the raw response} else {// --- Full HTML Mode ---fullContentResponse += chunk; // Accumulate for preview// Use regex to find the start of the HTML docconst newHtmlMatch = fullContentResponse.match(/<!DOCTYPE html>[\s\S]*/);const newHtml = newHtmlMatch ? newHtmlMatch[0] : null;
src/components/ask-ai/ask-ai.tsx+2-4