diff --git a/src/Limbo.Umbraco.Tables/PropertyEditors/TablePropertyIndexValueFactory.cs b/src/Limbo.Umbraco.Tables/PropertyEditors/TablePropertyIndexValueFactory.cs index 12d1095..b42c629 100644 --- a/src/Limbo.Umbraco.Tables/PropertyEditors/TablePropertyIndexValueFactory.cs +++ b/src/Limbo.Umbraco.Tables/PropertyEditors/TablePropertyIndexValueFactory.cs @@ -39,9 +39,26 @@ internal class TablePropertyIndexValueFactory : IPropertyIndexValueFactory { } private static IEnumerable ProcessRow(JArray row) { + foreach (JToken cell in row) { - yield return cell.Value("value")?.StripHtml(); + + JToken? value = cell.Value("value"); + + switch (value?.Type) { + + case JTokenType.String: + yield return value.Value()?.StripHtml(); + break; + + case JTokenType.Object: + string? markup = ((JObject) value).GetValue("markup")?.Value(); + yield return markup?.StripHtml(); + break; + + } + } + } } \ No newline at end of file diff --git a/src/Limbo.Umbraco.Tables/wwwroot/Scripts/Controllers/TableDataEditor.js b/src/Limbo.Umbraco.Tables/wwwroot/Scripts/Controllers/TableDataEditor.js index 367e212..78dea57 100644 --- a/src/Limbo.Umbraco.Tables/wwwroot/Scripts/Controllers/TableDataEditor.js +++ b/src/Limbo.Umbraco.Tables/wwwroot/Scripts/Controllers/TableDataEditor.js @@ -164,7 +164,7 @@ value: cell.value }, submit: function (model) { - cell.value = model.prop.value?.markup ? model.prop.value.markup : model.prop.value; + cell.value = typeof model.prop.value === "string" ? model.prop.value : model.prop.value?.markup ?? ""; editorService.close(); }, close: function () {