diff --git a/web/app/components/base/markdown-blocks/audio-block.tsx b/web/app/components/base/markdown-blocks/audio-block.tsx index b3c7f0deac..09001f105b 100644 --- a/web/app/components/base/markdown-blocks/audio-block.tsx +++ b/web/app/components/base/markdown-blocks/audio-block.tsx @@ -3,8 +3,8 @@ * Extracted from the main markdown renderer for modularity. * Uses the AudioGallery component to display audio players. */ -import React, { memo } from 'react'; -import AudioGallery from '@/app/components/base/audio-gallery'; +import React, { memo } from 'react' +import AudioGallery from '@/app/components/base/audio-gallery' const AudioBlock: any = memo(({ node }: any) => { const srcs = node.children.filter((child: any) => 'properties' in child).map((child: any) => (child as any).properties.src) @@ -18,4 +18,4 @@ const AudioBlock: any = memo(({ node }: any) => { }) AudioBlock.displayName = 'AudioBlock' -export default AudioBlock; +export default AudioBlock diff --git a/web/app/components/base/markdown-blocks/code-block.tsx b/web/app/components/base/markdown-blocks/code-block.tsx index 38786a1e79..cede9b469f 100644 --- a/web/app/components/base/markdown-blocks/code-block.tsx +++ b/web/app/components/base/markdown-blocks/code-block.tsx @@ -1,19 +1,19 @@ import { memo, useEffect, useMemo, useRef, useState } from 'react' -import ReactEcharts from 'echarts-for-react'; -import SyntaxHighlighter from 'react-syntax-highlighter'; +import ReactEcharts from 'echarts-for-react' +import SyntaxHighlighter from 'react-syntax-highlighter' import { atelierHeathDark, atelierHeathLight, -} from 'react-syntax-highlighter/dist/esm/styles/hljs'; -import ActionButton from '@/app/components/base/action-button'; -import CopyIcon from '@/app/components/base/copy-icon'; -import SVGBtn from '@/app/components/base/svg'; -import Flowchart from '@/app/components/base/mermaid'; -import { Theme } from '@/types/app'; -import useTheme from '@/hooks/use-theme'; -import SVGRenderer from '../svg-gallery'; // Assumes svg-gallery.tsx is in /base directory -import MarkdownMusic from '@/app/components/base/markdown-blocks/music'; -import ErrorBoundary from '@/app/components/base/markdown'; +} from 'react-syntax-highlighter/dist/esm/styles/hljs' +import ActionButton from '@/app/components/base/action-button' +import CopyIcon from '@/app/components/base/copy-icon' +import SVGBtn from '@/app/components/base/svg' +import Flowchart from '@/app/components/base/mermaid' +import { Theme } from '@/types/app' +import useTheme from '@/hooks/use-theme' +import SVGRenderer from '../svg-gallery' // Assumes svg-gallery.tsx is in /base directory +import MarkdownMusic from '@/app/components/base/markdown-blocks/music' +import ErrorBoundary from '@/app/components/base/markdown' // Available language https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/master/AVAILABLE_LANGUAGES_HLJS.MD const capitalizationLanguageNameMap: Record = { @@ -385,4 +385,4 @@ const CodeBlock: any = memo(({ inline, className, children = '', ...props }: any }) CodeBlock.displayName = 'CodeBlock' -export default CodeBlock; +export default CodeBlock diff --git a/web/app/components/base/markdown-blocks/img.tsx b/web/app/components/base/markdown-blocks/img.tsx index 86dd302820..33fce13f0b 100644 --- a/web/app/components/base/markdown-blocks/img.tsx +++ b/web/app/components/base/markdown-blocks/img.tsx @@ -3,11 +3,11 @@ * Extracted from the main markdown renderer for modularity. * Uses the ImageGallery component to display images. */ -import React from 'react'; -import ImageGallery from '@/app/components/base/image-gallery'; +import React from 'react' +import ImageGallery from '@/app/components/base/image-gallery' const Img = ({ src }: any) => { return
} -export default Img; +export default Img diff --git a/web/app/components/base/markdown-blocks/index.ts b/web/app/components/base/markdown-blocks/index.ts index e52eba0e18..ba68b4e8b1 100644 --- a/web/app/components/base/markdown-blocks/index.ts +++ b/web/app/components/base/markdown-blocks/index.ts @@ -3,16 +3,16 @@ * This allows for cleaner imports in other parts of the application. */ -export { default as AudioBlock } from './audio-block'; -export { default as CodeBlock } from './code-block'; -export { default as Img } from './img'; -export { default as Link } from './link'; -export { default as Paragraph } from './paragraph'; -export { default as PreCode } from './pre-code'; -export { default as ScriptBlock } from './script-block'; -export { default as VideoBlock } from './video-block'; +export { default as AudioBlock } from './audio-block' +export { default as CodeBlock } from './code-block' +export { default as Img } from './img' +export { default as Link } from './link' +export { default as Paragraph } from './paragraph' +export { default as PreCode } from './pre-code' +export { default as ScriptBlock } from './script-block' +export { default as VideoBlock } from './video-block' // Assuming these are also standalone components in this directory intended for Markdown rendering -export { default as MarkdownButton } from './button'; -export { default as MarkdownForm } from './form'; -export { default as ThinkBlock } from './think-block'; +export { default as MarkdownButton } from './button' +export { default as MarkdownForm } from './form' +export { default as ThinkBlock } from './think-block' diff --git a/web/app/components/base/markdown-blocks/link.tsx b/web/app/components/base/markdown-blocks/link.tsx index d074bb473e..5104d1ea04 100644 --- a/web/app/components/base/markdown-blocks/link.tsx +++ b/web/app/components/base/markdown-blocks/link.tsx @@ -3,8 +3,8 @@ * Extracted from the main markdown renderer for modularity. * Handles special rendering for "abbr:" type links for interactive chat actions. */ -import React from 'react'; -import { useChatContext } from '@/app/components/base/chat/chat/context'; +import React from 'react' +import { useChatContext } from '@/app/components/base/chat/chat/context' const Link = ({ node, children, ...props }: any) => { if (node.properties?.href && node.properties.href?.toString().startsWith('abbr')) { @@ -19,4 +19,4 @@ const Link = ({ node, children, ...props }: any) => { } } -export default Link; +export default Link diff --git a/web/app/components/base/markdown-blocks/paragraph.tsx b/web/app/components/base/markdown-blocks/paragraph.tsx index 4d66a8330e..fb1612477a 100644 --- a/web/app/components/base/markdown-blocks/paragraph.tsx +++ b/web/app/components/base/markdown-blocks/paragraph.tsx @@ -3,8 +3,8 @@ * Extracted from the main markdown renderer for modularity. * Handles special rendering for paragraphs that directly contain an image. */ -import React from 'react'; -import ImageGallery from '@/app/components/base/image-gallery'; +import React from 'react' +import ImageGallery from '@/app/components/base/image-gallery' const Paragraph = (paragraph: any) => { const { node }: any = paragraph @@ -24,4 +24,4 @@ const Paragraph = (paragraph: any) => { return

{paragraph.children}

} -export default Paragraph; +export default Paragraph diff --git a/web/app/components/base/markdown-blocks/pre-code.tsx b/web/app/components/base/markdown-blocks/pre-code.tsx index c63efa657d..a9d0cfb9aa 100644 --- a/web/app/components/base/markdown-blocks/pre-code.tsx +++ b/web/app/components/base/markdown-blocks/pre-code.tsx @@ -3,7 +3,7 @@ * Extracted from the main markdown renderer for modularity. * This is a simple wrapper around the HTML
 element.
  */
-import React, { useRef } from 'react';
+import React, { useRef } from 'react'
 
 function PreCode(props: { children: any }) {
   const ref = useRef(null)
@@ -18,4 +18,4 @@ function PreCode(props: { children: any }) {
   )
 }
 
-export default PreCode;
+export default PreCode
diff --git a/web/app/components/base/markdown-blocks/script-block.tsx b/web/app/components/base/markdown-blocks/script-block.tsx
index f0961d050d..921e2bf049 100644
--- a/web/app/components/base/markdown-blocks/script-block.tsx
+++ b/web/app/components/base/markdown-blocks/script-block.tsx
@@ -4,7 +4,7 @@
  * Note: Current implementation returns the script tag as a string, which might not execute as expected in React.
  * This behavior is preserved from the original implementation and may need review for security and functionality.
  */
-import React, { memo } from 'react';
+import { memo } from 'react'
 
 const ScriptBlock = memo(({ node }: any) => {
   const scriptContent = node.children[0]?.value || ''
@@ -12,4 +12,4 @@ const ScriptBlock = memo(({ node }: any) => {
 })
 ScriptBlock.displayName = 'ScriptBlock'
 
-export default ScriptBlock;
+export default ScriptBlock
diff --git a/web/app/components/base/markdown-blocks/video-block.tsx b/web/app/components/base/markdown-blocks/video-block.tsx
index ee7aa1ecc3..9f1a36f678 100644
--- a/web/app/components/base/markdown-blocks/video-block.tsx
+++ b/web/app/components/base/markdown-blocks/video-block.tsx
@@ -3,8 +3,8 @@
  * Extracted from the main markdown renderer for modularity.
  * Uses the VideoGallery component to display videos.
  */
-import React, { memo } from 'react';
-import VideoGallery from '@/app/components/base/video-gallery';
+import React, { memo } from 'react'
+import VideoGallery from '@/app/components/base/video-gallery'
 
 const VideoBlock: any = memo(({ node }: any) => {
   const srcs = node.children.filter((child: any) => 'properties' in child).map((child: any) => (child as any).properties.src)
@@ -18,4 +18,4 @@ const VideoBlock: any = memo(({ node }: any) => {
 })
 VideoBlock.displayName = 'VideoBlock'
 
-export default VideoBlock;
+export default VideoBlock
diff --git a/web/app/components/base/markdown/error-boundary.tsx b/web/app/components/base/markdown/error-boundary.tsx
index 29c325c156..0e6876191a 100644
--- a/web/app/components/base/markdown/error-boundary.tsx
+++ b/web/app/components/base/markdown/error-boundary.tsx
@@ -5,7 +5,7 @@
  * logs those errors, and displays a fallback UI instead of the crashed component tree.
  * Primarily used around complex rendering logic like ECharts or SVG within Markdown.
  */
-import React, { Component } from 'react';
+import React, { Component } from 'react'
 // **Add an ECharts runtime error handler
 // Avoid error #7832 (Crash when ECharts accesses undefined objects)
 // This can happen when a component attempts to access an undefined object that references an unregistered map, causing the program to crash.
diff --git a/web/app/components/base/markdown/index.tsx b/web/app/components/base/markdown/index.tsx
index 3c3d9e713d..0e0dc41cf2 100644
--- a/web/app/components/base/markdown/index.tsx
+++ b/web/app/components/base/markdown/index.tsx
@@ -9,16 +9,16 @@ import { flow } from 'lodash-es'
 import cn from '@/utils/classnames'
 import { preprocessLaTeX, preprocessThinkTag } from './markdown-utils'
 import {
-  CodeBlock,
-  Paragraph,
-  VideoBlock,
   AudioBlock,
-  ScriptBlock,
+  CodeBlock,
   Img,
   Link,
   MarkdownButton,
   MarkdownForm,
-  ThinkBlock
+  Paragraph,
+  ScriptBlock,
+  ThinkBlock,
+  VideoBlock,
 } from '@/app/components/base/markdown-blocks'
 
 /**
diff --git a/web/app/components/base/markdown/markdown-utils.ts b/web/app/components/base/markdown/markdown-utils.ts
index 8a6eee31ac..ff7dd5db01 100644
--- a/web/app/components/base/markdown/markdown-utils.ts
+++ b/web/app/components/base/markdown/markdown-utils.ts
@@ -3,7 +3,7 @@
  * These functions were extracted from the main markdown renderer for better separation of concerns.
  * Includes preprocessing for LaTeX and custom "think" tags.
  */
-import { flow } from 'lodash-es';
+import { flow } from 'lodash-es'
 
 export const preprocessLaTeX = (content: string) => {
   if (typeof content !== 'string')