feat: register j/tsx syntax highlight (#455)
This commit is contained in:
parent
d51b713d2c
commit
4d036d1958
|
|
@ -5,6 +5,8 @@ import { ReactElement, createElement } from "react"
|
|||
import { toast } from "react-hot-toast"
|
||||
import { Element } from "react-scroll"
|
||||
import { refractor } from "refractor"
|
||||
import jsx from "refractor/lang/jsx"
|
||||
import tsx from "refractor/lang/tsx"
|
||||
import rehypeAutolinkHeadings from "rehype-autolink-headings"
|
||||
import rehypeInferDescriptionMeta from "rehype-infer-description-meta"
|
||||
import rehypeKatex from "rehype-katex"
|
||||
|
|
@ -69,6 +71,8 @@ export type Rendered = {
|
|||
}
|
||||
|
||||
refractor.alias("html", ["svelte", "vue"])
|
||||
refractor.register(tsx)
|
||||
refractor.register(jsx)
|
||||
|
||||
const rehypePrism = rehypePrismGenerator(refractor)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue