From 08496c699edb97e97bf4cb120ec0a95df98ec1b1 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Fri, 5 Jan 2024 21:48:00 +0500 Subject: [PATCH] editor: fix font size changes back after exiting list (fixes #3602) --- .../editor/patches/@tiptap+core+2.1.12.patch | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 packages/editor/patches/@tiptap+core+2.1.12.patch diff --git a/packages/editor/patches/@tiptap+core+2.1.12.patch b/packages/editor/patches/@tiptap+core+2.1.12.patch new file mode 100644 index 000000000..4924d7d50 --- /dev/null +++ b/packages/editor/patches/@tiptap+core+2.1.12.patch @@ -0,0 +1,28 @@ +diff --git a/node_modules/@tiptap/core/dist/index.js b/node_modules/@tiptap/core/dist/index.js +index 38c9884..2dad7fe 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 }) => { + return lift$1(state, dispatch); + }; + +-const liftEmptyBlock = () => ({ state, dispatch }) => { +- return liftEmptyBlock$1(state, dispatch); ++const liftEmptyBlock = () => ({ state, dispatch, editor }) => { ++ return liftEmptyBlock$1(state, (tr) => { ++ if (!dispatch) return true; ++ ++ const { selection, storedMarks } = state; ++ const marks = storedMarks || (selection.$to.parentOffset && selection.$from.marks()); ++ ++ const { splittableMarks } = editor.extensionManager; ++ const filteredMarks = marks.filter((mark) => ++ splittableMarks.includes(mark.type.name) ++ ); ++ tr.ensureMarks(filteredMarks) ++ ++ return dispatch(tr); ++ }); + }; + + const liftListItem = typeOrName => ({ state, dispatch }) => {