// Each nested level is a new paragraph
expect(result.text).not.toContain("\n\n\n");
});
});
describe("blockquote followed by other block elements", () => {
it("should have double newline between blockquote and heading", () => { const input = "> quote\n\n# Heading"; const result = markdownToIR(input);
it("should have double newline between blockquote and list", () => { const input = "> quote\n\n- item"; const result = markdownToIR(input);
// The list item becomes "• item"
expect(result.text).toBe("quote\n\n• item");
expect(result.text).not.toContain("\n\n\n");
});
it("should have double newline between blockquote and code block", () => { const input = "> quote\n\n```\ncode\n```"; const result = markdownToIR(input);
// Code blocks preserve their trailing newline
expect(result.text.startsWith("quote\n\ncode")).toBe(true);
expect(result.text).not.toContain("\n\n\n");
});
it("should have double newline between blockquote and horizontal rule", () => { const input = "> quote\n\n---\n\nparagraph"; const result = markdownToIR(input);
// HR just adds a newline in IR, but should not create triple newlines
expect(result.text).not.toContain("\n\n\n");
});
});
describe("blockquote with multi-paragraph content", () => {
it("should handle multi-paragraph blockquote followed by paragraph", () => { const input = "> first paragraph\n>\n> second paragraph\n\nfollowing paragraph"; const result = markdownToIR(input);
// Multi-paragraph blockquote should have proper internal spacing // AND proper spacing with following content
expect(result.text).toContain("first paragraph\n\nsecond paragraph");
expect(result.text).not.toContain("\n\n\n");
});
});
describe("blockquote prefix option", () => {
it("should include prefix and maintain proper spacing", () => { const input = "> quote\n\nparagraph"; const result = markdownToIR(input, { blockquotePrefix: "> " });
// With prefix, should still have proper spacing
expect(result.text).toBe("> quote\n\nparagraph");
expect(result.text).not.toContain("\n\n\n");
});
});
describe("edge cases", () => {
it("should handle empty blockquote followed by paragraph", () => { const input = ">\n\nparagraph"; const result = markdownToIR(input);
expect(result.text).not.toContain("\n\n\n");
});
it("should handle blockquote at end of document", () => { const input = "paragraph\n\n> quote"; const result = markdownToIR(input);
// No trailing triple newlines
expect(result.text).not.toContain("\n\n\n");
});
it("should handle multiple blockquotes with paragraphs between", () => { const input = "> first\n\nparagraph\n\n> second"; const result = markdownToIR(input);
describe("comparison with other block elements (control group)", () => {
it("paragraphs should have double newline separation", () => { const input = "paragraph 1\n\nparagraph 2"; const result = markdownToIR(input);
it("list followed by paragraph should have double newline", () => { const input = "- item 1\n- item 2\n\nparagraph"; const result = markdownToIR(input);
// Lists already work correctly
expect(result.text).toContain("• item 2\n\nparagraph");
expect(result.text).not.toContain("\n\n\n");
});
it("heading followed by paragraph should have double newline", () => { const input = "# Heading\n\nparagraph"; const result = markdownToIR(input);
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.