Creating a Mark
Use the staticcreate method to define a new mark.
Partial<MarkConfig<Options, Storage>> | (() => Partial<MarkConfig<Options, Storage>>)
The mark configuration object or a function that returns a configuration object.
Configuration Options
Marks inherit all configuration options from Extension, plus the following:inclusive
Whether the mark should be active when the cursor is at the boundary.boolean
If
true, the mark is active when the cursor is at its start/end. If false, it requires the cursor to be inside.excludes
Define which other marks this mark excludes.string
Space-separated mark names, or
"_" to exclude all other marks.exitable
Whether the mark can be exited at the end.boolean
default:"false"
If
true, pressing right arrow at the end of the mark will move outside of it.group
Define the group(s) this mark belongs to.string
Space-separated group names.
spanning
Whether the mark spans across multiple nodes.boolean
If
false, the mark is removed when split.code
Whether the mark represents code.boolean
default:"false"
Indicates that this mark contains code.
keepOnSplit
Whether to keep the mark after splitting a node.boolean
default:"true"
If
true, the mark continues after splitting a text block.parseHTML()
Define how to parse HTML into this mark.renderHTML()
Define how to render the mark as HTML.addAttributes()
Define attributes for the mark.addMarkView()
Define a custom mark view.Methods
configure()
Create a configured version of the mark.Partial<Options>
Options to override the default options.
extend()
Extend the mark with additional configuration.Partial<ExtendedConfig> | (() => Partial<ExtendedConfig>)
Additional configuration or a function that returns configuration.