mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-11-06 01:09:21 +00:00
Improve display of component comments, card notes
This commit is contained in:
1 parent
8701d2c26c
commit
b6b8f7a0fb
8 files changed
+31
-28
No files matched your search
@@ -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