From fdc819e1c8cd18e9c9d8a435645539050a284b11 Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 5 Dec 2024 08:51:11 +0700 Subject: [PATCH] fix: syntax highlight configurations that made everything dark --- .../TextMessage/MarkdownTextMessage.tsx | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx b/web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx index 2b91271ae1..6b416f1526 100644 --- a/web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx +++ b/web/screens/Thread/ThreadCenterPanel/TextMessage/MarkdownTextMessage.tsx @@ -5,14 +5,14 @@ import React, { memo } from 'react' import Markdown from 'react-markdown' -import latex from 'highlight.js/lib/languages/latex' import rehypeHighlight from 'rehype-highlight' import rehypeHighlightCodeLines from 'rehype-highlight-code-lines' import rehypeKatex from 'rehype-katex' import rehypeRaw from 'rehype-raw' import remarkMath from 'remark-math' -import 'katex/dist/katex.min.css' +import 'katex/dist/katex.min.css' +import 'highlight.js/styles/atom-one-dark.css' import { useClipboard } from '@/hooks/useClipboard' import { getLanguageFromExtension } from '@/utils/codeLanguageExtension' @@ -199,16 +199,7 @@ export const MarkdownTextMessage = memo( rehypePlugins={[ [rehypeKatex, { throwOnError: false }], rehypeRaw, - [ - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - rehypeHighlight, - { - languages: { latex }, - subset: false, - plainText: ['txt', 'text'], - }, - ], + rehypeHighlight, [rehypeHighlightCodeLines, { showLineNumbers: true }], wrapCodeBlocksWithoutVisit, ]}