Update RichTextPropertyEditor.cs (#19826)

Fix for https://github.com/umbraco/Umbraco-CMS/issues/19824 issue
This commit is contained in:
Andrej Davidovic
2025-07-31 17:11:06 +03:00
committed by GitHub
parent 965408df57
commit ce7ce10d64

View File

@@ -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);