Interface: CodeBlockEditorContextValue
A set of functions that modify the underlying code block node. Access this with the useCodeBlockEditorContext hook in your custom code editor components.
Properties
Property | Type | Description |
---|---|---|
lexicalNode | CodeBlockNode | The Lexical node that's being edited. |
parentEditor | LexicalEditor | The parent Lexical editor. |
setCode | (code : string ) => void | Updates the code contents of the code block. |
setLanguage | (language : string ) => void | Updates the language of the code block. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting for language examples. |
setMeta | (meta : string ) => void | Updates the meta of the code block. The meta is the additional string that comes after the code block language. |