From 185ed8dcd4ae89b92cdc400bd9e3b82caab9c301 Mon Sep 17 00:00:00 2001 From: CocoRoF Date: Wed, 12 Nov 2025 16:16:23 +0900 Subject: [PATCH] refactor: Remove normalization of non-standard pipe characters from MessageRenderer --- src/app/_common/components/chatParser/ChatParser.tsx | 6 +----- .../components/chatParser/ChatParserLatex.tsx | 12 ++++++++---- .../components/chatParser/ChatParserMarkdown.tsx | 1 - 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/app/_common/components/chatParser/ChatParser.tsx b/src/app/_common/components/chatParser/ChatParser.tsx index 7991edf2..c1721f44 100644 --- a/src/app/_common/components/chatParser/ChatParser.tsx +++ b/src/app/_common/components/chatParser/ChatParser.tsx @@ -25,8 +25,7 @@ import { findTodoDetailsBlocks } from '@/app/_common/components/chatParser/ChatParserTodoDetails'; import { - parseSimpleMarkdown, - normalizeTableSeparators + parseSimpleMarkdown } from '@/app/_common/components/chatParser/ChatParserMarkdown'; import { parseCitation } from '@/app/_common/components/chatParser/ChatParserCite'; import { convertToString, needsConversion } from '@/app/_common/components/chatParser/ChatParserNonStr'; @@ -91,9 +90,6 @@ export const MessageRenderer: React.FC = ({ return null; } - // 비표준 파이프 문자를 표준 Markdown 파이프로 정규화 - processedContent = normalizeTableSeparators(processedContent); - if (isUserMessage) { return (
diff --git a/src/app/_common/components/chatParser/ChatParserLatex.tsx b/src/app/_common/components/chatParser/ChatParserLatex.tsx index 04c0bb8d..44805694 100644 --- a/src/app/_common/components/chatParser/ChatParserLatex.tsx +++ b/src/app/_common/components/chatParser/ChatParserLatex.tsx @@ -139,7 +139,8 @@ export const findLatexBlocks = (text: string): LatexBlockInfo[] => { // 정규식을 사용한 더 정확한 LaTeX 블록 찾기 const blockRegex = /\$\$([\s\S]*?)\$\$/g; - const inlineRegex = /(? = []; @@ -421,10 +422,13 @@ export const processLatexInText = ( * 텍스트에 LaTeX가 포함되어 있는지 확인하는 헬퍼 함수 */ export const hasLatex = (text: string): boolean => { - // 블록 수식 ($$...$$) 또는 인라인 수식 ($...$) 패턴 확인 - // 멀티라인을 고려하여 dotAll 플래그 사용 + // 블록 수식 ($$...$$) 패턴 확인 const blockMathRegex = /\$\$[\s\S]*?\$\$/; - const inlineMathRegex = /(? { .replace(/\uFF5C/g, '|') // | (FULLWIDTH VERTICAL LINE) → | .replace(/|/g, '|') // | (FULLWIDTH VERTICAL LINE) → | .replace(/│/g, '|') // │ (BOX DRAWINGS) → | - .replace(/\u007C/g, '|') // | (VERTICAL LINE, 정규화) → | .replace(/\u01C0/g, '|') // ǀ (LATIN LETTER DENTAL CLICK) → | .replace(/\u05C0/g, '|') // ׀ (HEBREW PUNCTUATION PASEQ) → | .replace(/\u2758/g, '|') // ❘ (LIGHT VERTICAL BAR) → |