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:
@@ -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>
|
||||
@@ -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();
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user