dify/web/app/components/base/prompt-editor/plugins/code-highlight-block.tsx
2024-04-01 19:03:34 +08:00

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
}