-
Notifications
You must be signed in to change notification settings - Fork 416
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(@sanity): _regenerateKeys so that the MarkDefs left are only those allowed #6989
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
No changes to documentation |
Component Testing Report Updated Jun 20, 2024 11:30 AM (UTC)
|
@RitaDias - I'm wondering if it makes more sense to build you code into the It's already being used for the pasted content. |
Just had a chat with @skogsmaskin and it's best to keep it as it is since copy / pasting from PTE to anoter PTE doesn't run the normalizeBlock |
@RitaDias , any chance I could get you to open this PR against https://github.com/portabletext/editor instead? Then we don't have to port these changes to that repo/package after #7001 has been merged. Sorry for the inconvenience :( |
I'll do that :) |
Closing this, re-opened it on portabletext/editor#19 :) |
Description
Add fix for when PTE text is pasted from one input to another that it respects the allowed annotations
Before
Screen.Recording.2024-05-21.at.14.mp4
Testing
The added tests should be sufficient
_regenerateKeys
(test before normalization)preserves other marks that apply to the spans
While the original issue was detected on copy paste, I don't think it is necessary to add a test to target that use case in particular. We would have seen this as an issue when creating a doc via the terminal for example.
Notes for release
Fixes issue where when PTE text was copy pasted always kept the original annotations regardless of the receiving PTE customization