Browse Source

Merge pull request #4146 from mfilser/fix_trim_whitespace_at_multiline_editor_fields

Fixed trim whitespace at multiline editor fields
Lauri Ojansivu 3 năm trước cách đây
mục cha
commit
e8e5616832
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      client/lib/inlinedform.js

+ 2 - 1
client/lib/inlinedform.js

@@ -49,7 +49,8 @@ InlinedForm = BlazeComponent.extendComponent({
 
 
   getValue() {
   getValue() {
     const input = this.find('textarea,input[type=text]');
     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() {
   events() {