remove first character in query string if it is @, ! or #

This commit is contained in:
Moriz Wahl 2020-09-24 12:31:55 +02:00
parent af56c3dd4b
commit 0a11156d49

View File

@ -39,7 +39,8 @@ const matchBeginningOfWords = (str) => {
}
export function normalizeWhitespace(str) {
return str.replace(/\s+/g, ' ').trim()
// delete the first character if it is !, @ or #
return str.replace(/^([!@#])/, '').replace(/\s+/g, ' ').trim()
}
export function escapeSpecialCharacters(str) {