Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: code generation more than 300 line

Faisal Amirca2082853227
diff --git a/web-app/src/containers/RenderMarkdown.tsx b/web-app/src/containers/RenderMarkdown.tsx
index bfcb1608d..fb5189220 100644
--- a/web-app/src/containers/RenderMarkdown.tsx
+++ b/web-app/src/containers/RenderMarkdown.tsx
@@ -1,4 +1,3 @@
-/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable react-hooks/exhaustive-deps */
import ReactMarkdown, { Components } from 'react-markdown'
import remarkGfm from 'remark-gfm'
@@ -8,7 +7,6 @@ import rehypeKatex from 'rehype-katex'
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
import * as prismStyles from 'react-syntax-highlighter/dist/cjs/styles/prism'
import { memo, useState, useMemo } from 'react'
-import virtualizedRenderer from 'react-syntax-highlighter-virtualized-renderer'
import { getReadableLanguageName } from '@/lib/utils'
import { cn } from '@/lib/utils'
import { useCodeblock } from '@/hooks/useCodeblock'
@@ -75,8 +73,6 @@ function RenderMarkdownComponent({
// Generate a stable ID based on code content and language
const codeId = `code-${hashString(code.substring(0, 40) + language)}`
- const shouldVirtualize = code.split('\n').length > 300
-
return !isInline && !isUser ? (
<div className="relative overflow-hidden border rounded-md border-main-view-fg/2">
<style>
@@ -147,11 +143,6 @@ function RenderMarkdownComponent({
overflow: 'auto',
border: 'none',
}}
- renderer={
- shouldVirtualize
- ? (virtualizedRenderer() as (props: any) => React.ReactNode)
- : undefined
- }
PreTag="div"
CodeTag={'code'}
{...props}