From 61f29f57ec6157be8246b3d2ec2ebf551eb874cd Mon Sep 17 00:00:00 2001 From: abasic Date: Wed, 26 Nov 2025 12:21:31 +0100 Subject: [PATCH] Replace custom Paragraph extension with default Tiptap extension: The custom extension was removed because it does not provide any known value at this time and was causing issues when copying from Word. The Word issues manifested by ProseMirror-trailingBreak br elements being added that were not needed. --- .../edit/src/components/extensions/index.ts | 2 +- .../src/components/extensions/paragraph.ts | 23 ------------------- 2 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 packages/edit/src/components/extensions/paragraph.ts diff --git a/packages/edit/src/components/extensions/index.ts b/packages/edit/src/components/extensions/index.ts index 6370cf4..9aa9974 100644 --- a/packages/edit/src/components/extensions/index.ts +++ b/packages/edit/src/components/extensions/index.ts @@ -2,6 +2,7 @@ import Color from '@tiptap/extension-color'; import FontFamily from '@tiptap/extension-font-family'; import Highlight from '@tiptap/extension-highlight'; import OfficePaste from '@intevation/tiptap-extension-office-paste'; +import Paragraph from '@tiptap/extension-paragraph'; import Placeholder from '@tiptap/extension-placeholder'; import StarterKit from '@tiptap/starter-kit'; import Subscript from '@tiptap/extension-subscript'; @@ -17,7 +18,6 @@ import Underline from '@tiptap/extension-underline'; import FontSize from './font-size.ts'; import Image from './image.ts'; import Link from './link.ts'; -import Paragraph from './paragraph.ts'; import Tooltip from './tooltip.ts'; export default [ diff --git a/packages/edit/src/components/extensions/paragraph.ts b/packages/edit/src/components/extensions/paragraph.ts deleted file mode 100644 index 0e93abc..0000000 --- a/packages/edit/src/components/extensions/paragraph.ts +++ /dev/null @@ -1,23 +0,0 @@ -import Paragraph from '@tiptap/extension-paragraph'; - -export default Paragraph.extend({ - parseHTML() { - return [{ tag: 'div' }, { tag: 'p' }, { tag: 'span' }]; - }, - addGlobalAttributes() { - return [ - { - types: ['heading', 'paragraph'], - attributes: { - class: { - default: null, - parseHTML: (element) => element.getAttribute('class'), - renderHTML(attributes) { - return { class: attributes.class }; - }, - }, - }, - }, - ]; - }, -});