From 8e02c65184a91251ea631b3804c7da886bc073fc Mon Sep 17 00:00:00 2001 From: Sunny Hirai Date: Sun, 10 Oct 2021 21:22:32 -0700 Subject: [PATCH] docs: Fix lint maybe. --- docs/concepts/07-editor.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/concepts/07-editor.md b/docs/concepts/07-editor.md index 416167a43..7b4392c56 100644 --- a/docs/concepts/07-editor.md +++ b/docs/concepts/07-editor.md @@ -8,14 +8,12 @@ interface Editor { children: Node[] selection: Range | null operations: Operation[] - marks: Record | null - + marks: Omit | null // Schema-specific node behaviors. isInline: (element: Element) => boolean isVoid: (element: Element) => boolean normalizeNode: (entry: NodeEntry) => void onChange: () => void - // Overrideable core actions. addMark: (key: string, value: any) => void apply: (operation: Operation) => void @@ -49,7 +47,7 @@ For example, if you want to define link elements that are inline nodes: ```javascript const { isInline } = editor -editor.isInline = (element) => { +editor.isInline = element => { return element.type === 'link' ? true : isInline(element) } ``` @@ -59,7 +57,7 @@ Or maybe you want to override the `insertText` behavior to "linkify" URLs: ```javascript const { insertText } = editor -editor.insertText = (text) => { +editor.insertText = text => { if (isUrl(text)) { // ... return @@ -74,7 +72,7 @@ Or you can even define custom "normalizations" that take place to ensure that li ```javascript const { normalizeNode } = editor -editor.normalizeNode = (entry) => { +editor.normalizeNode = entry => { const [node, path] = entry if (Element.isElement(node) && node.type === 'link') {