fix: prevent duplicate IDs in MiniSearch (#5303)

pull/5304/head
Heptazhou 2 months 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 if (!section || !(section.text || section.titles)) break
const { anchor, text, titles } = section const { anchor, text, titles } = section
const id = anchor ? [fileId, anchor].join('#') : fileId const id = anchor ? [fileId, anchor].join('#') : fileId
index.has(id) && index.discard(id)
index.add({ index.add({
id, id,
text, text,

Loading…
Cancel
Save