提交 45d00cd5 编写于 作者: C Catouse

* improve search experience.

上级 b2b3e7fa
......@@ -488,16 +488,18 @@
weight = 100;
break;
default:
if(section.name.toLowerCase().includes(keyVal)) {
var sectionName = section.name.toLowerCase();
if(sectionName.includes(keyVal)) {
chooseThisKey = true;
matchType = ['section', 'name'];
weight = 80;
weight = sectionName.startsWith(keyVal) ? 85 : 80;
break;
}
if(chapter.name.toLowerCase().includes(keyVal)) {
var chapterName = chapter.name.toLowerCase();
if(chapterName.includes(keyVal)) {
chooseThisKey = true;
matchType = ['chapter', 'name'];
weight = 70;
weight = chapterName.startsWith(keyVal) ? 75 : 70;
break;
}
if(keyVal.length > 1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册