mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
More cleanup
This commit is contained in:
parent
347c69ebe6
commit
4898b4bb9e
1 changed files with 1 additions and 11 deletions
|
|
@ -12,17 +12,7 @@ const MemoizedReactMarkdown: FC<Options> = memo(
|
|||
(prevProps, nextProps) => prevProps.children === nextProps.children && prevProps.className === nextProps.className,
|
||||
)
|
||||
|
||||
const preprocessLaTeX = (content: string) => {
|
||||
// Replace block-level LaTeX delimiters \[ \] with $$ $$
|
||||
const blockProcessedContent = content.replace(/\\\[([\s\S]*?)\\\]/g, (_, equation) => `$$${equation}$$`)
|
||||
|
||||
// Replace inline LaTeX delimiters \( \) with $ $
|
||||
return blockProcessedContent.replace(/\\\[([\s\S]*?)\\\]/g, (_, equation) => `$${equation}$`)
|
||||
}
|
||||
|
||||
export function Markdown({ content }: { content: string }) {
|
||||
const processedContent = preprocessLaTeX(content)
|
||||
|
||||
return (
|
||||
<MemoizedReactMarkdown
|
||||
remarkPlugins={[remarkGfm]}
|
||||
|
|
@ -85,7 +75,7 @@ export function Markdown({ content }: { content: string }) {
|
|||
)
|
||||
},
|
||||
}}>
|
||||
{processedContent}
|
||||
{content}
|
||||
</MemoizedReactMarkdown>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue