vdoc: search fix titles (#7681)
parent
27db4b4c23
commit
7bd0c5bc03
|
@ -125,8 +125,8 @@ function setupSearch() {
|
||||||
var searchIndexLength = searchIndex.length;
|
var searchIndexLength = searchIndex.length;
|
||||||
var results = [];
|
var results = [];
|
||||||
for (var i = 0; i < searchIndexLength; i++) {
|
for (var i = 0; i < searchIndexLength; i++) {
|
||||||
var title = searchIndex[i].toLowerCase();
|
var title = searchIndex[i];
|
||||||
if (title.indexOf(searchValue) === -1) {
|
if (title.toLowerCase().indexOf(searchValue) === -1) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// [badge, description, link]
|
// [badge, description, link]
|
||||||
|
|
|
@ -743,7 +743,11 @@ fn (mut cfg DocConfig) create_search_results(mod string, dn doc.DocNode) {
|
||||||
dn_description := trim_doc_node_description(dn.comment)
|
dn_description := trim_doc_node_description(dn.comment)
|
||||||
cfg.search_index << dn.name
|
cfg.search_index << dn.name
|
||||||
cfg.search_data << SearchResult{
|
cfg.search_data << SearchResult{
|
||||||
prefix: '$dn.kind ($dn.parent_name)'
|
prefix: if dn.parent_name != '' {
|
||||||
|
'$dn.kind ($dn.parent_name)'
|
||||||
|
} else {
|
||||||
|
'$dn.kind '
|
||||||
|
}
|
||||||
description: dn_description
|
description: dn_description
|
||||||
badge: mod
|
badge: mod
|
||||||
link: cfg.get_file_name(mod) + '#' + get_node_id(dn)
|
link: cfg.get_file_name(mod) + '#' + get_node_id(dn)
|
||||||
|
|
Loading…
Reference in New Issue