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

This commit is contained in:
pengx17
2024-12-20 02:08:44 +00:00
parent c6603ad182
commit 0fdf2c4905

View File

@@ -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();
}
}