[PRO]: TableOfContents w/ Collab keeps adding extra blank nodes to content #4829
Labels
Category: Pro
The issue or pull request is related to the pro packages of Tiptap.
Type: Bug
The issue or pullrequest is related to a bug
Which packages did you experience the bug in?
react, extension-table-of-contents, extension-collaboration
What Tiptap version are you using?
2.1.16
What’s the bug you are facing?
We are seeing a bug where empty lines are created when running collab and table of contents (ToC) together. Specificlly when asking ToC to index paragraph nodes. Before collab sync is complete, ToC will index the empty editor's default placeholder paragraph.
<p id="8fa..." data-toc-id="8fa66..." data-placeholder="Body Copy" class="is-empty"><br class="ProseMirror-trailingBreak"></p>
anchorTypes: ['heading', 'paragraph'],
The reason collab begins with an empty editor instead of the content from the record is that TipTap has a duplication problem when starting with content provided in the
content
propIf the content is passed in client side, Collab sees this as a change/addition to the content it has, and doubles everything on each page load.
What browser are you using?
Chrome
Code example
No response
What did you expect to happen?
We would expect Table of Contents (ToC) to ignore empty paragraph nodes until content is actually in the node. Or have ToC wait for Collab sync, if Collab is enabled, before indexing the content.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: