Fix rendering and parsing new RTE markup object in backoffice (#15166)

* Render RTE markup in custom view

* Fix ncRichText filter to support RTE markup object
This commit is contained in:
Ronald Barendse
2023-11-09 06:30:25 +01:00
committed by GitHub
parent 1ba025cf8b
commit 915b63db29
2 changed files with 7 additions and 4 deletions

View File

@@ -21,5 +21,5 @@
</style>
<div class="text" ng-click="block.edit()" ng-focus="block.focus" ng-bind-html="block.data.richText" style="margin: 0 20px;">
<div class="text" ng-click="block.edit()" ng-focus="block.focus" ng-bind-html="block.data.richText.markup" style="margin: 0 20px;">
</div>

View File

@@ -1,4 +1,4 @@
// Filter to take a node id and grab it's name instead
// Filter to take a node id and grab it's name instead
// Usage: {{ pickerAlias | ncNodeName }}
// Cache for node names so we don't make a ton of requests
@@ -78,6 +78,9 @@ angular.module("umbraco.filters").filter("ncNodeName", function (editorState, en
}).filter("ncRichText", function () {
return function (input) {
return $("<div/>").html(input).text();
// Get markup from RTE object or assume HTML
var html = input && Object.hasOwn(input, 'markup') ? input.markup : input;
return $("<div/>").html(html).text();
};
});