diff --git a/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts b/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts index 067c503f14..f697e6f3d5 100644 --- a/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts +++ b/packages/frontend/core/src/modules/docs-search/worker/in-worker.ts @@ -433,7 +433,8 @@ function unindentMarkdown(markdown: string) { current = current.trimStart(); } else { // For subsequent list items, maintain relative indentation - current = ' '.repeat(indent - baseIndent) + current.trimStart(); + current = + ' '.repeat(Math.max(0, indent - baseIndent)) + current.trimStart(); } }