Skip to main content

prosemirror-trailing-node

package prosemirror-trailing-node

function trailingNode()

This creates the plugin for trailing node.

import { schema } from 'prosemirror-schema-basic';
import { trailingNode } from 'prosemirror-trailing-node';

// Include the plugin in the created editor state.
const state = EditorState.create({
schema,
plugins: [trailingNode({ ignoredNodes: [], nodeName: 'paragraph' })],
});

Signature:

export declare function trailingNode(options?: TrailingNodePluginOptions): Plugin<boolean>;

Parameters:

ParameterTypeDescription
optionsTrailingNodePluginOptions(Optional) the options that can be provided to this plugin.

Returns:

Plugin<boolean>

interface TrailingNodePluginOptions

Signature:

export interface TrailingNodePluginOptions 

property ignoredNodes

The nodes for which this rule should not apply.

Signature:

ignoredNodes?: string[];

property nodeName

The node to create at the end of the document.

**Note**: the nodeName will always be added to the ignoredNodes lists to prevent an infinite loop.

Signature:

nodeName?: string;