-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: prohibit paste text/html content into email editor, allow paste … #5478
fix: prohibit paste text/html content into email editor, allow paste … #5478
Conversation
👷 Deploy request for dev-web-novu pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for novu-design ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
hello @YugfeldID! 👋 thanks for the contribution! 🤝
I think that this is the right approach for now, but I noticed some problems with the current implementation:
- variables are not recognized
- the undo (cmd + Z) works weird
My feelings is that the inserted text node is not recognized somehow as a text change that's why the weird behaviour with undo. The another solution is to use document.execCommand('insertText', false, pastedData);
but its deprecated and not recommended.
Hello @LetItRock, thanks for feedback. I pushed some changes:
|
This PR is being marked as stale due to inactivity. |
This PR is being closed due to inactivity. Please reopen if work is intended to be continued. |
fix for #5445
What changed? Why was the change needed?
Blocks paste text/html content into the email editor (allow paste only text/plain). Problem: when the user copies text from the rich text editor (like the editor from the In-App channel) all styles will be copied, it leads to an inability to process variables and clear formatting.
Screenshots
Without fix pasted content can look like this (with the inability to change the font, clear background, remove list items, and bold formatting):
Special notes for your reviewer
If this approach is okay, I will add a test