Skip to content

LLM Wiki is a cross-platform desktop application that turns your documents into an organized, interlinked knowledge base — automatically. Instead of traditional RAG (retrieve-and-answer from scratch every time), the LLM incrementally builds and maintains a persistent wiki from your sources。

TypeScript

fix: consume lone pipe lines in text chunker

nash_su4af0e8a38dd4
diff --git a/src/lib/text-chunker.ts b/src/lib/text-chunker.ts
index 37e14b64..5165be23 100644
--- a/src/lib/text-chunker.ts
+++ b/src/lib/text-chunker.ts
@@ -347,12 +347,14 @@ function tokenizeAtoms(text: string): Atom[] {
}
// Regular paragraph: accumulate consecutive non-blank, non-special lines.
+ // Do not exclude leading `|` here. A lone pipe-prefixed line that
+ // fell through the table branch above must be consumed as paragraph
+ // text; otherwise `i` never advances and the outer loop spins forever.
const start = cursor
const bodyLines: string[] = []
while (
i < lines.length &&
lines[i].trim() !== "" &&
- !lines[i].startsWith("|") &&
!/^(`{3,}|~{3,})/.test(lines[i])
) {
bodyLines.push(lines[i])