push
30 of 439 branches covered (6.83%)
Branch coverage included in aggregate %.
0 of 485 new or added lines in 18 files covered. (0.0%)
148 of 31568 relevant lines covered (0.47%)
9.28 hits per line
|
NEW
|
import type {JSX} from 'react'
|
|
|
NEW
|
|
× |
|
NEW
|
import {registerCodeHighlighting} from '@lexical/code'
|
× |
|
NEW
|
import {useLexicalComposerContext} from '@lexical/react/LexicalComposerContext'
|
× |
|
NEW
|
import {useEffect} from 'react'
|
× |
|
NEW
|
|
× |
|
NEW
|
export default function CodeHighlightPlugin(): JSX.Element | null { |
× |
|
NEW
|
const [editor] = useLexicalComposerContext()
|
× |
|
NEW
|
|
× |
|
NEW
|
useEffect(() => {
|
× |
|
NEW
|
return registerCodeHighlighting(editor)
|
× |
|
NEW
|
}, [editor]) |
× |
|
NEW
|
|
× |
|
NEW
|
return null
|
× |
|
NEW
|
} |
× |