Update RichTextPropertyEditor.cs (#19826)
Fix for https://github.com/umbraco/Umbraco-CMS/issues/19824 issue
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user