mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Remove guard on whitspace
We can just trim instead
This commit is contained in:
@ -126,12 +126,12 @@
|
|||||||
// Return/Enter key press otherwise bail
|
// Return/Enter key press otherwise bail
|
||||||
if (e.keyCode !== 13) return;
|
if (e.keyCode !== 13) return;
|
||||||
|
|
||||||
let word = document.getElementById("searchbox").value
|
let word = document.getElementById("searchbox").value;
|
||||||
document.getElementById("searchbox").value = "";
|
document.getElementById("searchbox").value = "";
|
||||||
|
|
||||||
word = word.toLowerCase();
|
word = word.toLowerCase();
|
||||||
word = word.replace(/[`'"]/gi, " ")
|
word = word.replace(/[`'"]/gi, " ");
|
||||||
safe_word = sanitize(word)
|
|
||||||
|
let safe_word = sanitize(word).trimLeft();
|
||||||
|
|
||||||
if (word.includes("\\n")) {
|
if (word.includes("\\n")) {
|
||||||
window.alert("Nice try...");
|
window.alert("Nice try...");
|
||||||
@ -143,11 +143,6 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (safe_word.startsWith(" ")) {
|
|
||||||
window.alert("Illegal first character");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Display filtered word
|
// Display filtered word
|
||||||
words.push(word);
|
words.push(word);
|
||||||
$("#ignored-words").append(
|
$("#ignored-words").append(
|
||||||
|
Reference in New Issue
Block a user