From 2f9cdfb8cd47cfdd67e06a6abfa2a1011abce744 Mon Sep 17 00:00:00 2001 From: sairajzero Date: Wed, 3 Nov 2021 17:48:51 +0530 Subject: [PATCH] Bug fix - Fixed: flo-data fix not showing for new line. - All space type char (eg. new line, tab) is converted to space - Rest of the invalid characters are removed --- index.html | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 23925cb..9ac59c8 100644 --- a/index.html +++ b/index.html @@ -2856,16 +2856,8 @@ }) function checkFloData(){ isFloDataChanged = false - const floDataText = sentFloData.value.trim() - let isValid = true - for(char of floDataText){ - // if(/^[a-z0-9\s!"#$%&'()*+,.\/:;<=>?@\[\]^_`{|}~-]*$/i.test(char)){ - if(!/^[\x20-\x7E\s]+/.test(char)){ - isValid = false - break; - } - } - if(isValid){ + const floDataText = sentFloData.value; + if(/^[\x20-\x7E]*$/.test(floDataText)){ sendFloDataButton.classList.remove('hide-completely') fixFloDataButton.classList.add('hide-completely') floDataStaus.textContent = '' @@ -2875,8 +2867,8 @@ } } function removeInvalid(){ - const floDataText = sentFloData.value.trim() - sentFloData.value = floDataText.replace(/[^\x20-\x7E]*/gm, '') + const floDataText = sentFloData.value; + sentFloData.value = floDataText.replace(/\s/g, " ").replace(/[^\x20-\x7E]/g, ''); checkFloData() }