Improve display of component comments, card notes

This commit is contained in:
Francis Lachapelle
2017-06-14 20:41:18 -04:00
parent 8701d2c26c
commit b6b8f7a0fb
8 changed files with 31 additions and 28 deletions
@@ -1,21 +0,0 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
* ln2br - A filter to convert line feeds and carriage returns to html line breaks
* @memberof SOGo.Common
*/
(function () {
'use strict';
/**
* @ngInject
*/
function ln2br() {
return function(text) {
return text ? String(text).replace(/\r?\n/gm, '<br>') : undefined;
};
}
angular.module('SOGo.Common')
.filter('ln2br', ln2br);
})();
@@ -0,0 +1,23 @@
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/**
* txt2html - A filter to convert line feeds and carriage returns to html line breaks
* @memberof SOGo.Common
*/
(function () {
'use strict';
/**
* @ngInject
*/
txt2html.$inject = ['linkyFilter'];
function txt2html(linkyFilter) {
return function(text) {
// Linky will first sanitize the text; linefeeds are therefore encoded.
return text ? String(linkyFilter(text, ' _blank')).replace(/&#10;/gm, '<br>') : undefined;
};
}
angular.module('SOGo.Common')
.filter('txt2html', txt2html);
})();