Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Updates tiptap/core dependency to fix space trim issue #261

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidnelson777
Copy link

What problem does this solve?

Any time you have two words with bold, italic, underline, etc, formatting on them and a space between them without any of that format, it is removed when used as the initialContent for the editor.
closes #247

How does this solve it?

Updates the dependency for tiptap/core to 2.5.5 where this issue was resolved in the base library.
See:
https://github.com/ueberdosis/tiptap/pull/4838/files#diff-4b20a33fe5fc9a20a2ec6cd2a45a0d7df7167ca7aff4612cb3a530864e4265eb
and:
ueberdosis/tiptap#4792 (comment)

Test plan:

  • Run yarn install
  • Run yarn editor:build-web-utils

You should see a new lib-web folder, and inside index.mjs around line the 10372
r.nodeType === 3 && r.nodeValue && !/\S/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && Mi(r);
should be replaced by
r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? n.removeChild(r) : r.nodeType === 1 && Ca(r);

@davidnelson777 davidnelson777 changed the title Updates tiptap/core dependency to fix space trim issue Fix: Updates tiptap/core dependency to fix space trim issue Jan 7, 2025
@davidnelson777 davidnelson777 force-pushed the Update_tiptap_dependency_to_fix_issue_247 branch from a525265 to a6c64d6 Compare January 7, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Unformatted spaces are removed between two formatted words
1 participant