vdoc: search fix titles (#7681)
parent
27db4b4c23
commit
7bd0c5bc03
|
@ -125,8 +125,8 @@ function setupSearch() {
|
|||
var searchIndexLength = searchIndex.length;
|
||||
var results = [];
|
||||
for (var i = 0; i < searchIndexLength; i++) {
|
||||
var title = searchIndex[i].toLowerCase();
|
||||
if (title.indexOf(searchValue) === -1) {
|
||||
var title = searchIndex[i];
|
||||
if (title.toLowerCase().indexOf(searchValue) === -1) {
|
||||
continue
|
||||
}
|
||||
// [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)
|
||||
cfg.search_index << dn.name
|
||||
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
|
||||
badge: mod
|
||||
link: cfg.get_file_name(mod) + '#' + get_node_id(dn)
|
||||
|
|
Loading…
Reference in New Issue