From 9e5c8ee77d1d86fe57122125824864588bd3683a Mon Sep 17 00:00:00 2001 From: Yuxuan Zhang Date: Sat, 30 Dec 2023 13:06:34 -0500 Subject: [PATCH] underscore _splitIntoSections to avoid being included in client side code --- src/node/plugins/localSearchPlugin.ts | 2 +- types/default-theme.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/plugins/localSearchPlugin.ts b/src/node/plugins/localSearchPlugin.ts index 96039a56..85fa1fe8 100644 --- a/src/node/plugins/localSearchPlugin.ts +++ b/src/node/plugins/localSearchPlugin.ts @@ -132,7 +132,7 @@ export async function localSearchPlugin( const html = await render(file) const sections = // user provided generator - (await options.miniSearch?.splitIntoSections?.(file, html)) ?? + (await options.miniSearch?._splitIntoSections?.(file, html)) ?? // default implementation splitPageIntoSections(html) // add sections to the locale index diff --git a/types/default-theme.d.ts b/types/default-theme.d.ts index 3de86d8b..be5cd0d3 100644 --- a/types/default-theme.d.ts +++ b/types/default-theme.d.ts @@ -436,7 +436,7 @@ export namespace DefaultTheme { * @param {string} path - absolute path to the markdown source file * @param {string} html - document page rendered as html */ - splitIntoSections?: ( + _splitIntoSections?: ( path: string, html: string ) =>