Skip to main content

extension-code

package @remirror/extension-code

class CodeExtension

Add a code mark to the editor. This is used to mark inline text as a code snippet.

Signature:

export declare class CodeExtension extends MarkExtension 

Extends: MarkExtension

(Some inherited members may not be shown because they are not represented in the documentation.)

property name

Signature:

get name(): "code";

method createInputRules

Signature:

createInputRules(): InputRule[];

Returns:

InputRule[]

method createKeymap

Signature:

createKeymap(): KeyBindings;

Returns:

KeyBindings

method createMarkSpec

Signature:

createMarkSpec(extra: ApplySchemaAttributes, override: MarkSpecOverride): MarkExtensionSpec;

Parameters:

ParameterTypeDescription
extraApplySchemaAttributes
overrideMarkSpecOverride

Returns:

MarkExtensionSpec

method createPasteRules

Signature:

createPasteRules(): MarkPasteRule[];

Returns:

MarkPasteRule[]

method createTags

Signature:

createTags(): ("code" | "excludeFromInputRules")[];

Returns:

("code" | "excludeFromInputRules")[]

method keyboardShortcut

Signature:

keyboardShortcut(props: KeyBindingProps): boolean;

Parameters:

ParameterTypeDescription
propsKeyBindingProps

Returns:

boolean

method toggleCode

Toggle the current selection as a code mark.

Signature:

toggleCode(): CommandFunction;

Returns:

CommandFunction