Open rosenbauerwillbacker opened 2 months ago
I tried to fix the package code myself. However, I found out that the code is obfuscated. Thus, I am at your mercy of resolving this issue.
Thank you in advance for your support!!
Reading through the code it looks like this was intentional though I cannot understand why. Would need @bdbch to shed light on it
Affected Packages
@tiptap-pro/extension-unique-id, @tiptap-react
Version(s)
2.10.11
Description of the Bug
When you have nodes with no content, the unique-id is regenerated.
Example 1: Headings
Editor options:
Parse and render HTML content:
The console.log statement returns:
As you can see the second heading doesn't preserve it's id, but regenerates a new one.
Example 2: Custom extension
Test Extension (simply renders the id):
Setting the content:
Rendered content:
Again the second id is not preserved.
Important note: This bug only occurs when the content of the node is empty and only then to the following node. So we have headings with content everything works as intended. This is particularly painful when building a custom node that doesn't have any content.
Browser Used
Chrome
Code Example (Preferred)
No response
Expected Behavior
The ids should be preserved and not regenerate.
Additional Context (Optional)
No response
Dependency Updates