diff --git a/docs/api/editor.md b/docs/api/editor.md index eb07a60d1..c7270a9c2 100644 --- a/docs/api/editor.md +++ b/docs/api/editor.md @@ -316,6 +316,20 @@ Call a function, deferring normalization until after it completes. ### Schema-specific methods to override +These methods can and should be replaced to modify the original behavior of the editor which is a part of building [Plugins](/concepts/07-plugins). When you modify behavior, call the original method where appropriate. For example, a plugin that marks image nodes as "void": + +```js +const withImages = editor => { + const { isVoid } = editor + + editor.isVoid = element => { + return element.type === 'image' ? true : isVoid(element) + } + + return editor +} +``` + ###### `isInline(element: Element)` Check if a value is an inline `Element` object.