1.18.1 - fix description pattern in title (#3179)

* bump version
* add comment to customer/project/activity entity and collections api 
* improve title pattern usage
This commit is contained in:
Kevin Papst
2022-02-28 16:32:41 +01:00
committed by GitHub
parent 2ad7629c2a
commit b08c156552
17 changed files with 35 additions and 25 deletions

View File

@@ -224,15 +224,17 @@ export default class KimaiFormSelect extends KimaiPlugin {
title = title.replace(new RegExp('{' + field + '}', 'g'), value ?? '');
}
title = title.replace(/- \?-\?/, '');
title = title.replace(/\r\n|\r|\n/g, ' ');
title = title.substr(0, 110);
const chars = '- ';
let start = 0, end = title.length;
while(start < end && chars.indexOf(title[start]) >= 0) {
while (start < end && chars.indexOf(title[start]) >= 0) {
++start;
}
while(end > start && chars.indexOf(title[end - 1]) >= 0) {
while (end > start && chars.indexOf(title[end - 1]) >= 0) {
--end;
}