Skip to content

Commit

Permalink
fix(search): properly group nested headings
Browse files Browse the repository at this point in the history
fixes #2238
  • Loading branch information
brc-dd committed Apr 16, 2023
1 parent 17558db commit b1c956c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node/plugins/localSearchPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ function splitPageIntoSections(html: string) {
const anchor = headingResult?.[2] ?? ''
const content = result[i + 2]
if (!title || !content) continue
const titles = [...parentTitles]
const titles = parentTitles.slice(0, level)
titles[level] = title
sections.push({ anchor, titles, text: getSearchableText(content) })
if (level === 0) {
Expand Down

0 comments on commit b1c956c

Please sign in to comment.