Custom extensions
Use a mark to format part of a line, a block for a standalone paragraph, or an Extension object to keep custom attributes or register commands.
- Create an inline formatUse mark() to add a format to part of a line. Select Yurich and click Highlight. The selected word is wrapped in <mark>.
- Create a custom blockUse block() to format an entire paragraph. Put the caret inside the paragraph and click Callout. The paragraph becomes an <aside> block.
- Define an extensionUse an Extension object when a format needs attributes, multiple commands, or its own active state. This example stores a numeric identifier on a <cite> element.
- Extension referenceUse these fields to define an Extension object. For an example with a validated attribute and custom commands, see Define an extension.
- Verify an extensionCheck the command, HTML round trip, JSON, and undo before using a new extension in your app.