Skip to content

Commit

Permalink
Merge pull request #4223 from janhq/fix/syntax-highlight-correction
Browse files Browse the repository at this point in the history
fix: syntax highlight configurations that made everything dark
  • Loading branch information
louis-jan authored Dec 5, 2024
2 parents 2ab306e + fdc819e commit e56b3e4
Showing 1 changed file with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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,
]}
Expand Down

0 comments on commit e56b3e4

Please sign in to comment.