-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Added RTF Copy and Cut Feature #3407
base: develop
Are you sure you want to change the base?
Conversation
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. |
@VenomHare Thank you for looking on these. but I tested the copy and cut functionality, and it already works as expected. Copying and pasting into Google Docs maintains the original formatting. This change might not be necessary. |
Thanks for reviewing it, @Jatin24062005 ! While the existing functionality preserves formatting when copying to Google Docs, this change also ensures that color, font size, and weight are retained. However, I understand if the maintainers prefer not to add it unnecessarily. |
@VenomHare apologies for the confusion. Your approach ensures better RTF handling, and I appreciate the effort you put into this! One small suggestion: I noticed that while the font weight and color are correctly copied, the font name itself isn’t retained. It would be even better if the copied content also preserved the font name when pasted into editors like Google Docs or Word. Would it be possible to include that as well? |
@Jatin24062005 Appreciate your suggestion! I looked into it and made some changes. However, there's a limitation—CodeMirror uses the Let me know your thoughts on it ! |
Fixes #445
Changes Made:
Added event listeners for copy and cut to support RTF (Rich Text Format) when copying text.
Implemented functionality based on a previous PR, but now utilizing the Copy and Cut events provided by CodeMirror.
Functionality:
The implemented solution works with:
✅ Keyboard Shortcuts: Ctrl + C (Copy) and Ctrl + X (Cut).
✅ Copy option via Context Menu.
I have verified that this pull request:
npm run lint
)npm run test
)develop
branch.Fixes #445
This is my first contribution to Open Source, and I appreciate any feedback or suggestions for improvement.