mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-06 23:43:19 +00:00
Improve display of component comments, card notes
This commit is contained in:
@@ -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(/ /gm, '<br>') : undefined;
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('SOGo.Common')
|
||||
.filter('txt2html', txt2html);
|
||||
})();
|
||||
Reference in New Issue
Block a user