vdoc: search fix titles (#7681)

This commit is contained in:
Daniel Däschle 2020-12-29 20:01:12 +01:00 committed by GitHub
parent 27db4b4c23
commit 7bd0c5bc03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -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)