commit b3244e1663e859a17bb2c514e5bc48ce8128c31c
parent 3df85c450c663b4e372070d23e96cf764aaf6ee0
Author: breadcat <breadcat@users.noreply.github.com>
Date: Thu, 21 May 2026 15:54:51 +0100
Strip apostrophes from first word
Fixes im > I'm breaking prefixes on mobile keyboards
Diffstat:
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/index.html b/index.html
@@ -309,9 +309,16 @@
: "";
}
+ function normalizeInput(raw) {
+ const spaceIndex = raw.indexOf(" ");
+ if (spaceIndex === -1) return raw.replace(/'/g, "");
+ return raw.slice(0, spaceIndex).replace(/'/g, "") + raw.slice(spaceIndex);
+ }
+
input.addEventListener("input", (e) => {
- filterBookmarks(e.target.value);
- updatePrediction(e.target.value);
+ const value = normalizeInput(e.target.value);
+ filterBookmarks(value);
+ updatePrediction(value);
});
input.addEventListener("keydown", (e) => {
@@ -342,7 +349,7 @@
if (selectedBookmarkIndex >= 0) {
window.open(filteredBookmarks[selectedBookmarkIndex].url, "_self");
} else {
- handleCommand(input.value);
+ handleCommand(normalizeInput(input.value));
}
} else if (e.key === "Escape") {
input.value = "";