We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
yyx990803
kiaking
brc-dd
posva
Learn more about funding links in repositories.
Report abuse
1 parent e13f932 commit f7aef3cCopy full SHA for f7aef3c
src/node/plugins/localSearchPlugin.ts
@@ -235,8 +235,9 @@ function* splitPageIntoSections(html: string) {
235
const anchor = headingResult?.[2] ?? ''
236
const content = result[i + 2]
237
if (!title || !content) continue
238
- const titles = parentTitles.slice(0, level)
+ let titles = parentTitles.slice(0, level)
239
titles[level] = title
240
+ titles = titles.filter(Boolean)
241
yield { anchor, titles, text: getSearchableText(content) }
242
if (level === 0) {
243
parentTitles = [title]
0 commit comments