fix(webui): stop repairing completed Markdown
This commit is contained in:
1 parent
fc3effe39d
commit
450a85fe0e
6 files changed
+48
-7
No files matched your search
@@ -25,12 +25,14 @@ const MemoizedMarkdownRenderer = memo(function MemoizedMarkdownRenderer({
|
||||
className,
|
||||
highlightCode,
|
||||
streaming,
|
||||
preserveStreamingLayout,
|
||||
onOpenFilePreview,
|
||||
}: {
|
||||
source: string;
|
||||
className?: string;
|
||||
highlightCode: boolean;
|
||||
streaming: boolean;
|
||||
preserveStreamingLayout: boolean;
|
||||
onOpenFilePreview?: (path: string) => void;
|
||||
}) {
|
||||
return (
|
||||
@@ -38,6 +40,7 @@ const MemoizedMarkdownRenderer = memo(function MemoizedMarkdownRenderer({
|
||||
className={className}
|
||||
highlightCode={highlightCode}
|
||||
streaming={streaming}
|
||||
preserveStreamingLayout={preserveStreamingLayout}
|
||||
onOpenFilePreview={onOpenFilePreview}
|
||||
>
|
||||
{source}
|
||||
@@ -81,7 +84,6 @@ export function MarkdownText({
|
||||
const renderedSource = children;
|
||||
const renderPhase = streaming ? "streaming" : "complete";
|
||||
const highlightCode = !streaming;
|
||||
const renderWithStreamingLayout = streaming || preserveStreamingLayout;
|
||||
|
||||
useEffect(() => {
|
||||
if (streaming) void preloadMarkdownText();
|
||||
@@ -106,7 +108,8 @@ export function MarkdownText({
|
||||
source={renderedSource}
|
||||
className={className}
|
||||
highlightCode={highlightCode}
|
||||
streaming={renderWithStreamingLayout}
|
||||
streaming={streaming}
|
||||
preserveStreamingLayout={preserveStreamingLayout}
|
||||
onOpenFilePreview={onOpenFilePreview}
|
||||
/>
|
||||
</Suspense>
|
||||
|
||||
Reference in new issue
Block a user