From 2c2631033bfe84a236350d456647dbb386aea3d4 Mon Sep 17 00:00:00 2001 From: zonemeen Date: Thu, 11 Jan 2024 20:02:33 +0800 Subject: [PATCH] refactor --- src/node/plugins/localSearchPlugin.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node/plugins/localSearchPlugin.ts b/src/node/plugins/localSearchPlugin.ts index 8fd1478e..76faf941 100644 --- a/src/node/plugins/localSearchPlugin.ts +++ b/src/node/plugins/localSearchPlugin.ts @@ -166,9 +166,7 @@ export async function localSearchPlugin( for await (const section of sections) { if (!section || !(section.text || section.titles)) break let { anchor, text, titles } = section - if (parentTitles.length) { - titles = [...parentTitles, ...titles] - } + titles = [...parentTitles, ...titles] const id = anchor ? [fileId, anchor].join('#') : fileId index.add({ id,