forked from github/plane
12 lines
367 B
TypeScript
12 lines
367 B
TypeScript
|
import { useEffect } from "react";
|
||
|
import { registerCodeHighlighting } from "@lexical/code";
|
||
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
||
|
|
||
|
export const CodeHighlightPlugin = () => {
|
||
|
const [editor] = useLexicalComposerContext();
|
||
|
useEffect(() => {
|
||
|
return registerCodeHighlighting(editor);
|
||
|
}, [editor]);
|
||
|
return null;
|
||
|
};
|