Prevent RTE being marked as dirty when content contains empty paragraph#20335
Prevent RTE being marked as dirty when content contains empty paragraph#20335AndyButland merged 1 commit intoumbraco:v13/devfrom
Conversation
In Tinymce, an empty paragraph is marked with a non-breaking space character. When saving the content, the DOMParser replaces this empty non-breaking space character with an entity. This causes the editor to always be dirty when the content contains an empty paragraph. By making these the same befor the comparison, this is prevented.
|
Hi there @mcl-sz, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
|
It's not entirely clear to me whether I should use the "dev" or "main" branch to submit the change. |
AndyButland
left a comment
There was a problem hiding this comment.
Thanks @mcl-sz, it does look like this solves the problem. I've followed along with your testing steps and tried a few more combinations, and am no longer seeing the incorrect dialog for pending changes.
Prerequisites
If there's an existing issue for this PR then this fixes #18127 #16922
Description
In Tinymce, an empty paragraph is filled with a non-breaking space character. When saving the content, the DOMParser replaces this empty non-breaking space character with an
entity. This causes the editor to be dirty when the content contains an empty paragraph. By making these the same before the comparison, this is prevented.Tesing
Apply the patch and try the last 2 steps again. The "Unsaved changes"-dialog doesn't appear anymore.