From ce7ce10d649a7b5dde6bba37c01e40aeddc78ece Mon Sep 17 00:00:00 2001 From: Andrej Davidovic Date: Thu, 31 Jul 2025 17:11:06 +0300 Subject: [PATCH] Update RichTextPropertyEditor.cs (#19826) Fix for https://github.com/umbraco/Umbraco-CMS/issues/19824 issue --- .../PropertyEditors/RichTextPropertyEditor.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs index f9be27e551..89415fb258 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextPropertyEditor.cs @@ -263,8 +263,6 @@ public class RichTextPropertyEditor : DataEditor richTextEditorValue?.EnsurePropertyTypePopulatedOnBlocks(_elementTypeCache); currentRichTextEditorValue?.EnsurePropertyTypePopulatedOnBlocks(_elementTypeCache); - RichTextEditorValue cleanedUpRichTextEditorValue = CleanAndMapBlocks(richTextEditorValue, blockValue => MapBlockValueFromEditor(blockValue, currentRichTextEditorValue?.Blocks, editorValue.ContentKey)); - if (string.IsNullOrWhiteSpace(richTextEditorValue?.Markup)) { return null; @@ -284,6 +282,7 @@ public class RichTextPropertyEditor : DataEditor var sanitized = _htmlSanitizer.Sanitize(editorValueWithMediaUrlsRemoved); richTextEditorValue.Markup = sanitized.NullOrWhiteSpaceAsNull() ?? string.Empty; + RichTextEditorValue cleanedUpRichTextEditorValue = CleanAndMapBlocks(richTextEditorValue, blockValue => MapBlockValueFromEditor(blockValue, currentRichTextEditorValue?.Blocks, editorValue.ContentKey)); // return json return RichTextPropertyEditorHelper.SerializeRichTextEditorValue(cleanedUpRichTextEditorValue, _jsonSerializer);