feat(lists): alternate markdown list markers by nesting depth

Ordered lists switch between `1.` (even depth) and `A.` (odd depth).
Unordered lists switch between `-` (even depth) and `*` (odd depth).
Makes nested list structure visually distinct in extracted text.
This commit is contained in:
2026-04-06 13:39:43 +05:30
parent 2c0ccee5e1
commit a2c8bd31c6
3 changed files with 40 additions and 16 deletions
+3 -3
View File
@@ -334,8 +334,8 @@ describe("HTMLTextSplitter", () => {
const html = [
'<pre class="list-markdown">',
"1. First",
" 1. Nested 1",
" 2. Nested 2",
" A. Nested 1",
" B. Nested 2",
"2. Second",
"</pre>",
].join("\n");
@@ -343,7 +343,7 @@ describe("HTMLTextSplitter", () => {
const chunks = await splitter.splitText(html);
expect(chunks).toEqual([
"1. First\n 1. Nested 1\n 2. Nested 2\n2. Second",
"1. First\n A. Nested 1\n B. Nested 2\n2. Second",
]);
});
});