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
OptionalhtmlReopen?: { close: string; open: string }Lets a mark tell the Markdown serializer which inline HTML tags it can safely use when plain markdown delimiters would become ambiguous.
This is mainly useful for overlapping marks. For example, bold followed
by bold+italic followed by italic cannot always be written back with only
* and ** in a way that still parses correctly. In that case, the
serializer can close the overlapping section with markdown and reopen the
remaining tail with HTML instead.
Example:
**123 + *456* + 789 italic**123*456***<em>789</em>If your extension defines custom mark names, set htmlReopen on that
extension so the serializer can reuse its HTML form for overlap cases.
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.
OptionaltransformThis function transforms pasted HTML content before it's parsed. Extensions can use this to modify or clean up pasted HTML. The transformations are chained - each extension's transform receives the output from the previous extension's transform.
This function adds commands to the editor