From a4ac34d8aa8453317afdaceab2b97239ea95170e Mon Sep 17 00:00:00 2001 From: Martin Filser Date: Sat, 6 Nov 2021 11:27:07 +0100 Subject: [PATCH] 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 --- client/lib/inlinedform.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/lib/inlinedform.js b/client/lib/inlinedform.js index f0d2cc130..409b259d0 100644 --- a/client/lib/inlinedform.js +++ b/client/lib/inlinedform.js @@ -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() {