fix: prevent duplicate IDs in MiniSearch (#5303)

pull/5304/head
Heptazhou 4 days ago committed by GitHub
parent 31287c0b69
commit 505278c2cb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -134,6 +134,7 @@ export async function localSearchPlugin(
if (!section || !(section.text || section.titles)) break
const { anchor, text, titles } = section
const id = anchor ? [fileId, anchor].join('#') : fileId
index.has(id) && index.discard(id)
index.add({
id,
text,

Loading…
Cancel
Save