Fix literal \n characters appearing in proof analysis feedback
Gemini sometimes returns the literal two-character sequence \n instead of a real newline in agent feedback text. This caused "Recommendation:" to appear on the same line as "Issue:" with visible \n characters. Adding a normalization step at the start of formatFeedbackText converts literal \n sequences to real newlines so the existing line-splitting logic handles them correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
766b95f54c
commit
c8f473d9b7
1 changed files with 2 additions and 0 deletions
|
|
@ -41,6 +41,8 @@ const formatFeedbackText = (text: string): React.ReactNode => {
|
|||
|
||||
// First, handle HTML tags by converting them to a normalized format
|
||||
let normalizedText = text
|
||||
// Convert literal \n sequences to real newlines
|
||||
.replace(/\\n/g, '\n')
|
||||
// Replace </li> and </ul> with newlines
|
||||
.replace(/<\/li>/gi, '\n')
|
||||
.replace(/<\/ul>/gi, '\n')
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue