fix(ui): remove math plugins and disable single-tilde strikethrough
- Remove remarkMath and rehypeKatex plugins that caused text wrapping issues by interpreting $ signs as LaTeX delimiters - Configure remarkGfm with singleTilde: false to prevent single ~ from being parsed as strikethrough (e.g., ~1000 should not become <del>) - Only double tilde ~~text~~ now renders as strikethrough Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
ad26eec7d2
commit
374ce68b84
1 changed files with 2 additions and 5 deletions
|
|
@ -1,13 +1,10 @@
|
|||
import * as React from 'react'
|
||||
import ReactMarkdown, { type Components } from 'react-markdown'
|
||||
import rehypeKatex from 'rehype-katex'
|
||||
import rehypeRaw from 'rehype-raw'
|
||||
import remarkGfm from 'remark-gfm'
|
||||
import remarkMath from 'remark-math'
|
||||
import { cn } from '@multica/ui/lib/utils'
|
||||
import { CodeBlock, InlineCode } from './CodeBlock'
|
||||
import { preprocessLinks } from './linkify'
|
||||
import 'katex/dist/katex.min.css'
|
||||
|
||||
/**
|
||||
* Render modes for markdown content:
|
||||
|
|
@ -273,8 +270,8 @@ export function Markdown({
|
|||
return (
|
||||
<div className={cn('markdown-content break-words', className)}>
|
||||
<ReactMarkdown
|
||||
remarkPlugins={[remarkGfm, remarkMath]}
|
||||
rehypePlugins={[rehypeKatex, rehypeRaw]}
|
||||
remarkPlugins={[[remarkGfm, { singleTilde: false }]]}
|
||||
rehypePlugins={[rehypeRaw]}
|
||||
components={components}
|
||||
>
|
||||
{processedContent}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue