refactor(Markdown): disable single-tilde strikethrough (#8209)

This commit is contained in:
one 2025-07-17 09:57:37 +08:00 committed by GitHub
parent ff0994e1c7
commit aa254a3772
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,6 +21,7 @@ import rehypeRaw from 'rehype-raw'
import remarkCjkFriendly from 'remark-cjk-friendly'
import remarkGfm from 'remark-gfm'
import remarkMath from 'remark-math'
import { Pluggable } from 'unified'
import CodeBlock from './CodeBlock'
import Link from './Link'
@ -41,7 +42,11 @@ const Markdown: FC<Props> = ({ block }) => {
const { mathEngine } = useSettings()
const remarkPlugins = useMemo(() => {
const plugins = [remarkGfm, remarkCjkFriendly, remarkDisableConstructs(['codeIndented'])]
const plugins = [
[remarkGfm, { singleTilde: false }] as Pluggable,
remarkCjkFriendly,
remarkDisableConstructs(['codeIndented'])
]
if (mathEngine !== 'none') {
plugins.push(remarkMath)
}