From 5e6f580f25abf0c37c961e2eb7aad1e7fb550e97 Mon Sep 17 00:00:00 2001 From: Beep LIN Date: Tue, 20 Nov 2018 10:57:07 +0800 Subject: [PATCH 1/2] Update README.md: wrapIn -> toggleWrap Fix a mistake in README.md: `wrapIn` should be `toggleWrap`. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a0e6f62c..33328f33 100644 --- a/README.md +++ b/README.md @@ -300,7 +300,7 @@ Let's take a look at a real example. This is basically how the default `blockquo ```js import { Node } from 'tiptap' -import { wrappingInputRule, setBlockType, wrapIn } from 'tiptap-commands' +import { wrappingInputRule, setBlockType, toggleWrap } from 'tiptap-commands' export default class BlockquoteNode extends Node { @@ -333,14 +333,14 @@ export default class BlockquoteNode extends Node { // `type` is the prosemirror schema object for this blockquote // `schema` is a collection of all registered nodes and marks commands({ type, schema }) { - return wrapIn(type) + return toggleWrap(type) } // here you can register some shortcuts // in this case you can create a blockquote with `ctrl` + `>` keys({ type }) { return { - 'Ctrl->': wrapIn(type), + 'Ctrl->': toggleWrap(type), } } From 78b727213c9d5e5f8ca8b2bd839e3fc80e960e30 Mon Sep 17 00:00:00 2001 From: Beep LIN Date: Tue, 20 Nov 2018 10:58:51 +0800 Subject: [PATCH 2/2] Update README.md Fixes: `commands` should return a function which returns `toggleWrap(type)` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33328f33..c2fbd9af 100644 --- a/README.md +++ b/README.md @@ -333,7 +333,7 @@ export default class BlockquoteNode extends Node { // `type` is the prosemirror schema object for this blockquote // `schema` is a collection of all registered nodes and marks commands({ type, schema }) { - return toggleWrap(type) + return () => toggleWrap(type) } // here you can register some shortcuts