diff options
Diffstat (limited to 'src/search_js.h')
-rw-r--r-- | src/search_js.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/search_js.h b/src/search_js.h index 985d03c..422f580 100644 --- a/src/search_js.h +++ b/src/search_js.h @@ -5,7 +5,7 @@ " {\n" " var c = search.charAt(i);\n" " var cn = c.charCodeAt(0);\n" -" if (c.match(/[a-z0-9]/))\n" +" if (c.match(/[a-z0-9\\u0080-\\uFFFF]/))\n" " {\n" " result+=c;\n" " }\n" @@ -310,22 +310,20 @@ " var searchValue = this.DOMSearchField().value.replace(/^ +/, \"\");\n" "\n" " var code = searchValue.toLowerCase().charCodeAt(0);\n" -" var hexCode;\n" -" if (code<16) \n" +" var idxChar = searchValue.substr(0, 1).toLowerCase();\n" +" if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair\n" " {\n" -" hexCode=\"0\"+code.toString(16);\n" -" }\n" -" else \n" -" {\n" -" hexCode=code.toString(16);\n" +" idxChar = searchValue.substr(0, 2);\n" " }\n" "\n" " var resultsPage;\n" " var resultsPageWithSearch;\n" " var hasResultsPage;\n" "\n" -" if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')\n" +" var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);\n" +" if (idx!=-1)\n" " {\n" +" var hexCode=idx.toString(16);\n" " resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';\n" " resultsPageWithSearch = resultsPage+'?'+escape(searchValue);\n" " hasResultsPage = true;\n" |