CodeBlockEditorDescriptor interface
Implement this interface to create a custom code block editor. Pass the object in the codeBlockPlugin parameters.
Signature:
export interface CodeBlockEditorDescriptor
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
Editor | React.ComponentType<CodeBlockEditorProps> | The React component to be used. See CodeBlockEditorProps for the props passed to the component. | |
match | (language: string, meta: string) => boolean | A function that returns true if the descriptor's editor should be used for the given code block. | |
priority | number | The priority of the descriptor when descriptors are matched against a given code block. Lower number means lower priority. This allows you to implement a catch-all generic editor and a more specific editor for a given language / meta. |