-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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(extension-code-block): #3604 paste code from vscode #3606
fix(extension-code-block): #3604 paste code from vscode #3606
Conversation
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
8b48050
to
d9a672e
Compare
@bdbch Can you help to review this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@svenadlung cc
@svenadlung need your review, please |
ac5174a
to
62fff76
Compare
@aliasliao Thank you. I'll have a look next week due to public holidays. |
@aliasliao Sorry for the delay. There is a small difference in some cases. In that case the cursor after pasting is not in the code node, but in the following node. Can you please check again? |
da0bc06
to
62fff76
Compare
62fff76
to
c959c18
Compare
@svenadlung Hi, I have fixed (mostly) this issue in the latest commit. Could you please help to review it? There is one last case that I found hard to handle: if there is a CodeBlock after the cursor before pasting, the cursor remains inside that CodeBlock after pasting instead of moving to the newly created code block. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fixes #3604 , #3321
This line (L267) causes the wrong insertion position:
https://github.com/ueberdosis/tiptap/blob/main/packages/extension-code-block/src/code-block.ts#L267
Removing L267 can fix the bug.
But I think the better solution is to replace selection with a text node, rather than imperatively inserting the copied content : )
cc @bdbch