mirror of
https://github.com/langgenius/dify.git
synced 2026-03-25 21:23:51 +08:00
14 lines
366 B
TypeScript
14 lines
366 B
TypeScript
import { useEffect } from 'react'
|
|
import { registerCodeHighlighting } from '@lexical/code'
|
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
|
|
|
export default function CodeHighlightPlugin() {
|
|
const [editor] = useLexicalComposerContext()
|
|
|
|
useEffect(() => {
|
|
return registerCodeHighlighting(editor)
|
|
}, [editor])
|
|
|
|
return null
|
|
}
|