it("renders ordered > bullet > ordered nesting", () => { const input = `1. First
- Sub bullet 1. Deep ordered
- Another bullet 2. Second`;
const result = markdownToIR(input);
const expected = `1. First
• Sub bullet 1. Deep ordered
• Another bullet 2. Second`;
expect(result.text).toBe(expected);
});
});
describe("Nested Lists - Newline Handling", () => {
it("does not produce triple newlines in nested lists", () => { const input = `- Item 1
- Nested
- Item 2`;
const result = markdownToIR(input);
expect(result.text).not.toContain("\n\n\n");
});
it("does not produce double newlines between nested items", () => { const input = `- A
- B
- C
- D`;
const result = markdownToIR(input);
// Between B and C there should be exactly one newline
expect(result.text).toContain(" • B\n • C");
expect(result.text).not.toContain(" • B\n\n • C");
});
// markdownToIR trims trailing whitespace, so output should end with Item 2 // (no trailing newline after trimming)
expect(result.text).toMatch(/Item 2$/); // Should not have excessive newlines before Item 2
expect(result.text).not.toContain("\n\n• Item 2");
});
});
describe("Nested Lists - Edge Cases", () => {
it("handles empty parent with nested items", () => { // This is a bit of an edge case - a list item that's just a marker followed by nested content const input = `-
- Nested only
- Normal`;
const result = markdownToIR(input);
// Should still render the nested item with proper indentation
expect(result.text).toContain(" • Nested only");
});
it("handles nested list as first child of parent item", () => { const input = `- Parent text
- Child
- Another parent`;
const result = markdownToIR(input);
// The child should appear indented under the parent
expect(result.text).toContain("• Parent text\n • Child");
});
it("handles sibling nested lists at same level", () => { const input = `- A
- A1
- B
- B1`;
const result = markdownToIR(input);
const expected = `• A
• A1
• B
• B1`;
expect(result.text).toBe(expected);
});
});
describe("list paragraph spacing", () => {
it("adds blank line between bullet list and following paragraph", () => { const input = `- item 1
- item 2
Paragraph after`; const result = markdownToIR(input); // Should have two newlines between "item 2" and "Paragraph"
expect(result.text).toContain("item 2\n\nParagraph");
});
it("adds blank line between ordered list and following paragraph", () => { const input = `1. item 1 2. item 2
Paragraph after`; const result = markdownToIR(input);
expect(result.text).toContain("item 2\n\nParagraph");
});
it("does not produce triple newlines", () => { const input = `- item 1
- item 2
Paragraph after`; const result = markdownToIR(input); // Should NOT have three consecutive newlines
expect(result.text).not.toContain("\n\n\n");
});
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.