Skip to content

Commit

Permalink
POS: allow quick-searching even when the first word contains a dash (#14
Browse files Browse the repository at this point in the history
)
  • Loading branch information
akx authored Jan 17, 2024
1 parent f33462a commit 8fd040b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lippukala/templates/lippukala/pos.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
var nStarting = 0;
var inputCode = codeInput.value.toLowerCase();
var regexpText = "^" + inputCode;
if(/^[a-z]+ /i.test(inputCode)) { // Cheap "fuzzy" searching ("d bu" will match "desu butler")
if(/^[-a-z]+ /i.test(inputCode)) { // Cheap "fuzzy" searching ("d bu" will match "desu butler")
regexpText = "^" + inputCode.split(/\s+/).filter(function(word){return word.length>0;}).join("[^ ]*? ");
regexpText = regexpText.replace(/\s+$/, '');
}
Expand Down

0 comments on commit 8fd040b

Please sign in to comment.