fix: avoid splitting outbound chunks inside parentheses (#499) — thanks @philipp-spiess
This commit is contained in:
1 parent
4082b90aa4
commit
4a918ccf47
2 files changed
+7
No files matched your search
@@ -67,6 +67,12 @@ describe("chunkText", () => {
|
||||
const chunks = chunkText(text, 10);
|
||||
expect(chunks).toEqual(["Supercalif", "ragilistic", "expialidoc", "ious"]);
|
||||
});
|
||||
|
||||
it("keeps parenthetical phrases together", () => {
|
||||
const text = "Heads up now (Though now I'm curious)ok";
|
||||
const chunks = chunkText(text, 35);
|
||||
expect(chunks).toEqual(["Heads up now", "(Though now I'm curious)ok"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveTextChunkLimit", () => {
|
||||
|
||||
Reference in new issue
Block a user