fix(core): indexer worker crash on unexpected markdown indent (#9210)

This commit is contained in:
pengx17 committed 2024-12-20 02:08:44 +00:00
1 parent c6603ad182
commit 0fdf2c4905
1 file changed
+2 -1
@@ -433,7 +433,8 @@ function unindentMarkdown(markdown: string) {
current = current.trimStart(); current = current.trimStart();
} else { } else {
// For subsequent list items, maintain relative indentation // For subsequent list items, maintain relative indentation
current = ' '.repeat(indent - baseIndent) + current.trimStart(); current =
' '.repeat(Math.max(0, indent - baseIndent)) + current.trimStart();
} }
} }