Merge pull request #2018 from AndyButland/u4-4090

Fixes U4-4090 - by preserved line breaks in property descriptions...
This commit is contained in:
Claus
2017-06-29 14:43:13 +02:00
committed by GitHub
2 changed files with 13 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
/**
* @ngdoc filter
* @name umbraco.filters.preserveNewLineInHtml
* @description
* Used when rendering a string as HTML (i.e. with ng-bind-html) to convert line-breaks to <br /> tags
**/
angular.module("umbraco.filters").filter('preserveNewLineInHtml', function () {
return function (text) {
return text.replace(/\n/g, '<br />');
}
});

View File

@@ -11,7 +11,7 @@
<span ng-if="property.validation.mandatory">
<strong class="umb-control-required">*</strong>
</span>
<small ng-bind-html="property.description"></small>
<small ng-bind-html="property.description | preserveNewLineInHtml"></small>
</label>
<div class="controls" ng-transclude>