From 47db442d957cffd6b6f714fe5804272e5be55c11 Mon Sep 17 00:00:00 2001 From: CocoRoF Date: Wed, 12 Nov 2025 14:44:17 +0900 Subject: [PATCH] feat: Normalize non-standard pipe characters in MessageRenderer and parsing logic --- src/app/_common/components/chatParser/ChatParser.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/app/_common/components/chatParser/ChatParser.tsx b/src/app/_common/components/chatParser/ChatParser.tsx index 2726b03c..7991edf2 100644 --- a/src/app/_common/components/chatParser/ChatParser.tsx +++ b/src/app/_common/components/chatParser/ChatParser.tsx @@ -91,6 +91,9 @@ export const MessageRenderer: React.FC = ({ return null; } + // 비표준 파이프 문자를 표준 Markdown 파이프로 정규화 + processedContent = normalizeTableSeparators(processedContent); + if (isUserMessage) { return (
@@ -142,13 +145,12 @@ export const MessageRenderer: React.FC = ({ * 컨텐츠를 React 엘리먼트로 파싱 */ const parseContentToReactElements = (content: string, onViewSource?: (sourceInfo: SourceInfo) => void, onHeightChange?: () => void, mode?: "existing" | "new-workflow" | "new-default" | "deploy" | "embed"): React.ReactNode[] => { - // 이 시점에서 content는 이미 MessageRenderer에서 문자열로 변환되었음 + // 이 시점에서 content는 이미 MessageRenderer에서 문자열로 변환되고 정규화되었음 if (!content) { return []; } - // 비표준 파이프 문자를 먼저 정규화 - let processed = normalizeTableSeparators(content); + let processed = content; // 스트림 모드 감지를 위한 헬퍼 함수 const detectStreaming = (text: string, textStartIndex: number, totalLength: number): boolean => {