Skip to content

Commit d4805fa

Browse files
authored
Prevent RTE being marked as dirty when content contains empty paragraph (#20335)
Prevent RTE being marked as dirty when content containt empty paragraph 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.
1 parent 3deccdb commit d4805fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Umbraco.Web.UI.Client/src/common/services/tinymce.service.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,8 @@ function tinyMceService($rootScope, $q, imageHelper, $locale, $http, $timeout, s
14651465

14661466
function syncContent() {
14671467

1468-
const content = args.editor.getContent();
1468+
//get the content from tinyMCE and replace Non-breaking space character to HTML Entity
1469+
const content = args.editor.getContent().replace('\u00A0', ' ');
14691470

14701471
if (getPropertyValue() === content) {
14711472
return;

0 commit comments

Comments
 (0)