CodeBlockEditorContextValue interface

A set of functions that modify the underlying code block node. Get this with the useCodeBlockEditorContext() hook.

Signature:

export interface CodeBlockEditorContextValue 

Properties

PropertyModifiersTypeDescription
lexicalNodeCodeBlockNodeThe Lexical node that's being edited.
setCode(code: string) => voidUpdates the code contents of the code block.
setLanguage(language: string) => voidUpdates the language of the code block. See https://www.markdownguide.org/extended-syntax/#syntax-highlighting for language examples.
setMeta(meta: string) => voidUpdates the meta of the code block. The meta is the additional string that comes after the code block language.