OptionaladdOptionaladdThis function adds additional extensions to the editor. This is useful for building extension kits.
OptionaladdThis function adds globalAttributes to specific nodes.
addGlobalAttributes() {
return [
{
// Extend the following extensions
types: [
'heading',
'paragraph',
],
// … with those attributes
attributes: {
textAlign: {
default: 'left',
renderHTML: attributes => ({
style: `text-align: ${attributes.textAlign}`,
}),
parseHTML: element => element.style.textAlign || 'left',
},
},
},
]
}
OptionaladdThis function adds input rules to the editor.
OptionaladdThis function registers keyboard shortcuts.
OptionaladdThis method will add options to this extension
OptionaladdThis function adds paste rules to the editor.
OptionaladdThis function adds Prosemirror plugins to the editor
OptionaladdThe default storage this extension can save data to.
OptionaldispatchThis hook allows you to intercept and modify transactions before they are dispatched.
Example
dispatchTransaction({ transaction, next }) {
console.log('Dispatching transaction:', transaction)
next(transaction)
}
OptionalextendThis function extends the schema of the mark.
OptionalextendThis function extends the schema of the node.
OptionalmarkdownOptional markdown options for indentation
OptionalindentsContent?: booleanDefines if this markdown element should indent it's child elements
OptionalmarkdownThe markdown tokenizer responsible for turning a markdown string into tokens
Custom tokenizers are only needed when you want to parse non-standard markdown token.
OptionalmarkdownThe markdown token name
This is the name of the token that this extension uses to parse and render markdown and comes from the Marked Lexer.
The extension name - this must be unique. It will be used to identify the extension.
OptionalonThe editor is not ready yet.
OptionalonThe editor isn’t focused anymore.
OptionalonThe editor is ready.
OptionalonThe editor is destroyed.
OptionalonThe editor is focused.
OptionalonThe selection has changed.
OptionalonThe editor state has changed.
OptionalonThe content has changed.
OptionalparseThe parse function used by the markdown parser to convert markdown tokens to ProseMirror nodes.
OptionalpriorityThe priority of your extension. The higher, the earlier it will be called and will take precedence over other extensions with a lower priority.
OptionalrenderThe serializer function used by the markdown serializer to convert ProseMirror nodes to markdown tokens.
This function adds commands to the editor