theme: Improve search output

For pages with h6 only (e.g. frequently asked questions).
This commit is contained in:
Bjørn Erik Pedersen 2025-02-11 20:53:59 +01:00
parent 7e6b81ffa6
commit 49a2e7d71b
No known key found for this signature in database

View File

@ -14,13 +14,19 @@ const applyHelperFuncs = (array) => {
item.getHeadingHTML = function () {
let lvl2 = this._highlightResult.hierarchy.lvl2;
let lvl3 = this._highlightResult.hierarchy.lvl3;
if (!lvl2) {
if (!lvl3) {
if (lvl2) {
return lvl2.value;
}
return '';
}
if (lvl3) {
return `${lvl2.value} <span class="text-gray-500">&nbsp;>&nbsp;</span> ${lvl3.value}`;
if (!lvl2) {
return lvl3.value;
}
return lvl2.value;
return `${lvl2.value} <span class="text-gray-500">&nbsp;>&nbsp;</span> ${lvl3.value}`;
};
return item;
});