From 6cb6f47b56154220a1adc03984e42813e0cb5dc1 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Thu, 15 May 2025 00:36:08 -0700 Subject: Refactor: Replace MarkdownRenderer with MarkdownDisplay component - This commit refactors the Markdown rendering logic within the CLI UI. The existing `MarkdownRenderer.tsx` class-based component has been replaced with a new functional component `MarkdownDisplay.tsx`. - The `MarkdownDisplay` component is a React.memoized component for improved performance and maintains the same core Markdown parsing and rendering capabilities. --- packages/cli/src/ui/components/messages/GeminiMessageContent.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'packages/cli/src/ui/components/messages/GeminiMessageContent.tsx') diff --git a/packages/cli/src/ui/components/messages/GeminiMessageContent.tsx b/packages/cli/src/ui/components/messages/GeminiMessageContent.tsx index fb025231..b9b85dc7 100644 --- a/packages/cli/src/ui/components/messages/GeminiMessageContent.tsx +++ b/packages/cli/src/ui/components/messages/GeminiMessageContent.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { Box } from 'ink'; -import { MarkdownRenderer } from '../../utils/MarkdownRenderer.js'; +import { MarkdownDisplay } from '../../utils/MarkdownDisplay.js'; interface GeminiMessageContentProps { text: string; @@ -23,11 +23,10 @@ export const GeminiMessageContent: React.FC = ({ }) => { const originalPrefix = '✦ '; const prefixWidth = originalPrefix.length; - const renderedBlocks = MarkdownRenderer.render(text); return ( - {renderedBlocks} + ); }; -- cgit v1.2.3