mirror of
https://github.com/wekan/wekan.git
synced 2025-04-22 04:57:07 -04:00
remove empty lines
This commit is contained in:
parent
8164af281d
commit
b1c26e6f64
2 changed files with 14 additions and 15 deletions
|
@ -244,12 +244,12 @@ CardCustomField.register('cardCustomField');
|
|||
}
|
||||
|
||||
formattedValue() {
|
||||
lines = this.data().value.replace(/\r\n|\n\r|\n|\r/g, '\n').split('\n');
|
||||
lines = lines.map(line =>
|
||||
this.stringtemplateFormat.replace(/%\{value\}/gi, line)
|
||||
);
|
||||
|
||||
return lines.join(' ');
|
||||
return this.data().value
|
||||
.replace(/\r\n|\n\r|\n|\r/g, '\n')
|
||||
.split('\n')
|
||||
.filter(value => value.trim() != '')
|
||||
.map(value => this.stringtemplateFormat.replace(/%\{value\}/gi, value))
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
events() {
|
||||
|
|
|
@ -26,16 +26,15 @@ BlazeComponent.extendComponent({
|
|||
.customFieldsWD()
|
||||
.find(f => f._id === definition._id);
|
||||
|
||||
if(customField && customField.trueValue) {
|
||||
lines = customField.trueValue.replace(/\r\n|\n\r|\n|\r/g, '\n').split('\n');
|
||||
lines = lines.map(line =>
|
||||
definition.settings.stringtemplateFormat.replace(/%\{value\}/gi, line)
|
||||
);
|
||||
const customFieldTrueValue =
|
||||
customField && customField.trueValue ? customField.trueValue : '';
|
||||
|
||||
return lines.join(' ');
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
return customFieldTrueValue
|
||||
.replace(/\r\n|\n\r|\n|\r/g, '\n')
|
||||
.split('\n')
|
||||
.filter(value => value.trim() != '')
|
||||
.map(value => definition.settings.stringtemplateFormat.replace(/%\{value\}/gi, value))
|
||||
.join(' ');
|
||||
},
|
||||
|
||||
events() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue