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
This commit is contained in:
parent
42874ad6b9
commit
2f9cdfb8cd
16
index.html
16
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()
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user