Skip to main content

nodeInputRule

@blockslides/core


@blockslides/core / nodeInputRule

Function: nodeInputRule()

nodeInputRule(config): InputRule

Defined in: blockslides/packages/core/src/inputRules/nodeInputRule.ts:13

Build an input rule that adds a node when the matched text is typed into it.

Parameters

config

find

InputRuleFinder

The regex to match.

type

NodeType

The node type to add.

undoable?

boolean

Whether the input rule should be undoable when the user presses backspace.

getAttributes?

false | Record<string, any> | (match) => Record<string, any> | null

A function that returns the attributes for the node can also be an object of attributes

Returns

InputRule

See

https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#input-rules