From ba5a3c29fa9fd37d7e6070b3ead869e88ff1c39a Mon Sep 17 00:00:00 2001 From: Jed Date: Fri, 5 Jun 2020 01:25:23 +0200 Subject: [PATCH] add attrs param to toggleWrap function for nodeIsActive and WrapIn --- packages/tiptap-commands/src/commands/toggleWrap.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/tiptap-commands/src/commands/toggleWrap.js b/packages/tiptap-commands/src/commands/toggleWrap.js index bb71f5f3a..b8b4457c8 100644 --- a/packages/tiptap-commands/src/commands/toggleWrap.js +++ b/packages/tiptap-commands/src/commands/toggleWrap.js @@ -1,14 +1,14 @@ import { wrapIn, lift } from 'prosemirror-commands' import { nodeIsActive } from 'tiptap-utils' -export default function (type) { +export default function (type, attrs = {}) { return (state, dispatch, view) => { - const isActive = nodeIsActive(state, type) + const isActive = nodeIsActive(state, type, attrs) if (isActive) { return lift(state, dispatch) } - return wrapIn(type)(state, dispatch, view) + return wrapIn(type, attrs)(state, dispatch, view) } }