diff --git a/Readme.md b/Readme.md index 23dd2f8..6a304b9 100644 --- a/Readme.md +++ b/Readme.md @@ -19,7 +19,8 @@ Todo (sorted by priority) ------------------------- 1. ~~Make the search case-insensitive (as well as accents insensitive)~~ - 11. BUG: trim spaces from search expression + 11. ~~BUG: trim spaces from search expression~~ + 12. BUG: fix search for codes also 2. Create a nice html page (may take several steps) 3. Make it chrome compatible (some trouble with the first ajax call) 4. Make the search mis-spelling safe (like Google does) diff --git a/cherche.js b/cherche.js index b254f06..12d6624 100644 --- a/cherche.js +++ b/cherche.js @@ -211,7 +211,7 @@ function main() { //console.log(words.data); $( "#question" ).keyup(function () { var str = removeDiacritics($( "#question" ).val()); - var ans = words.find({'Word': { '$contains': str}}); + var ans = words.find({'Word': { '$contains': str.trim()}}); //console.log("Words found: ",ans); //console.log(displayMany(ans)); $( "#answer" ).empty().append(displayMany(ans));