Skip to content

Commit

Permalink
fix: code highlight (close AlistGo/alist#5222)
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Sep 15, 2023
1 parent f288c01 commit a1b6d78
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/components/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ import reMarkMath from "remark-math"
import rehypeKatex from "rehype-katex"
import "./markdown.css"
import "./katex.css"
import {
Show,
createEffect,
createMemo,
createSignal,
on,
onMount,
} from "solid-js"
import { Show, createEffect, createMemo, createSignal, on } from "solid-js"
import { clsx } from "clsx"
import { Box } from "@hope-ui/solid"
import { useParseText } from "~/hooks"
Expand All @@ -25,10 +18,6 @@ export const Markdown = (props: {
class?: string
ext?: string
}) => {
onMount(() => {
hljs.highlightAll()
window.onMDRender && window.onMDRender()
})
const [encoding, setEncoding] = createSignal<string>("utf-8")
const [show, setShow] = createSignal(true)
const { isString, text } = useParseText(props.children)
Expand All @@ -44,6 +33,8 @@ export const Markdown = (props: {
setShow(false)
setTimeout(() => {
setShow(true)
hljs.highlightAll()
window.onMDRender && window.onMDRender()
})
}),
)
Expand Down

0 comments on commit a1b6d78

Please sign in to comment.