-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
Solve update and revert issues in the writer #3758
Conversation
The savebar doesn't appear when I click it 🎉 But even if I save the page, the savebar appears every time I refresh the page. |
@afbora really? 😭😭😭😭 |
@afbora I just tried again and cannot reproduce the behaviour you describe. Can you post the steps you are taking? |
@bastianallgeier Here my steps revert.mp4 |
So it only happens when you paste something or also when you create blocks manually? |
Ok, I guess I just answered it myself. I can reproduce it when I paste stuff. |
Paste, yes. I'm digging which block occured when paste. |
I guess this issue about Actually
Expected
|
Yes, but this should still be solved as soon as you safe and reload. |
I've noticed, inserting |
Ok, I think I found it this time. When you paste from the clipboard, the OS/browser is adding invisible non-breaking spaces. Those cause the difference between the final HTML and the current state. It's pretty messed up, but the solution seems simple. |
Shit. It's still not fully solved. I hate this shit. |
Getting there |
Now works great except codecov 🙂 |
@afbora fixed |
Describe the PR
Prosemirror takes the content and applies its own HTML parsing rules. This means that whenever you add a new value to the Writer field from the backend or the value is being pasted from the clipboard, Prosemirror needs to have another look at the HTML first and make adjustments if needed.
So far, there was no update event after Prosemirror finished its own adjustments. That could cause a difference between the value that was pasted initially and whatever Prosemirror made out of it.
With this PR, the writer instantly sends an update if the initial HTML is different from the adjusted HTML. This update will make sure that the changes store is correct and reverting can happen properly.
Release notes
Fixes
Fixed regressions from 3.6.0-beta.2
Breaking changes
None
Related issues/ideas
Ready?
When merging