-
Notifications
You must be signed in to change notification settings - Fork 45
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
Link Edit removes marks (font size, bold, italics, etc) for selected link #237
Comments
Thanks for reporting. This is true of all marks (not just font size), where editing will remove the existing styling. Unfortunately Tiptap doesn't seem to provide any convenient mechanisms to fetch all marks for the selection (ueberdosis/tiptap#1511), but perhaps there's some way to still avoid this when editing a link. |
May solve the issue by getting direct node from selection. I'm not sure It's safe way. |
Thank you both for your quick responses. After reading all the I'm actually completely new to the TipTap Api. Maybe you have some good advice. |
in LinkBubbleMenu > index.tsx at line 98, It will retain styles applied even with text changed, but It will override following styles if different styles exist in the same link. Link will be changed to Link. |
@semanticist21 This solution would work for me. I tried to keep all the marks in my pull request, but it's hard to decide what mark a updated text should get. But it looks like there is a issue in your code. When you create a link with selected text, the text is duplicated after saving. |
Sorry for my mistake. In else statement,
|
Now the text marks are deleted after creating a link. |
Can you detail the situation? |
in Else statement
I'm a new to tiptap too, please understand. |
Looks good now. |
@sjdemartini Would you run the test process again? |
Describe the bug
After editing a link, the font style is removed.
Content before changing:
<p><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"http://foo.de\"><span style=\"font-size: 30px\">Bar</span></a></p>
Content after changing:
<p> <a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"http://foo.de\">Bar/a></p>
The same behaviour is in the TipTap Showcase.
To Reproduce
Add a Link and give it a specific font size.
Edit the link, after you saved the changes, the font size is reseted.
Expected behavior
The font style should be kept
System (please complete the following information)
mui-tiptap version: 1.9.1
tiptap version: 2.4.0
Browser: Chrome
The text was updated successfully, but these errors were encountered: