Update default value for string input

This commit is contained in:
barsdeveloper
2022-04-23 00:31:01 +02:00
parent 1a282b6c8c
commit 7f1a1b13d4
3 changed files with 41 additions and 0 deletions

View File

@@ -139,4 +139,14 @@ export default class Utility {
}
return [...(new Set(result.concat(...a, ...b)))]
}
/**
* @param {String} value
*/
static sanitizeInputString(value) {
return value
.replace(/\n$/, "") // Remove trailing newline
.replaceAll("\u00A0", " ") // Replace special space symbol
.replaceAll("\n", "\\r\\n") // Replace newline with \r\n
}
}