From 69aa9e284db5a6085d99d9aa866e8ea75fe62324 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 21 Feb 2024 13:54:53 +0500 Subject: [PATCH] editor: fix `marks.filter is not a function` error on pressing Enter --- packages/editor/patches/@tiptap+core+2.1.12.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/editor/patches/@tiptap+core+2.1.12.patch b/packages/editor/patches/@tiptap+core+2.1.12.patch index 4924d7d50..46bdf1753 100644 --- a/packages/editor/patches/@tiptap+core+2.1.12.patch +++ b/packages/editor/patches/@tiptap+core+2.1.12.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/@tiptap/core/dist/index.js b/node_modules/@tiptap/core/dist/index.js -index 38c9884..2dad7fe 100644 +index 38c9884..4a9e10c 100644 --- a/node_modules/@tiptap/core/dist/index.js +++ b/node_modules/@tiptap/core/dist/index.js -@@ -1876,8 +1876,21 @@ const lift = (typeOrName, attributes = {}) => ({ state, dispatch }) => { +@@ -1876,8 +1876,23 @@ const lift = (typeOrName, attributes = {}) => ({ state, dispatch }) => { return lift$1(state, dispatch); }; @@ -15,6 +15,8 @@ index 38c9884..2dad7fe 100644 + const { selection, storedMarks } = state; + const marks = storedMarks || (selection.$to.parentOffset && selection.$from.marks()); + ++ if (!marks) return dispatch(tr); ++ + const { splittableMarks } = editor.extensionManager; + const filteredMarks = marks.filter((mark) => + splittableMarks.includes(mark.type.name)