Fixed trim whitespace at multiline editor fields

- before whitespaces were only trimmed if 2 or more whitespaces were at
  the end of the line
- now every whitespace is trimmed at the end of each line
This commit is contained in:
Martin Filser 2021-11-06 11:27:07 +01:00
parent 1eca7c9996
commit a4ac34d8aa

View file

@ -49,7 +49,8 @@ InlinedForm = BlazeComponent.extendComponent({
getValue() {
const input = this.find('textarea,input[type=text]');
return this.isOpen.get() && input && input.value.replaceAll(/\s +$/gm, '');
// \s without \n + unicode (https://developer.mozilla.org/de/docs/Web/JavaScript/Guide/Regular_Expressions#special-white-space)
return this.isOpen.get() && input && input.value.replaceAll(/[ \f\r\t\v]+$/gm, '');
},
events() {