";
- }
- }`);
expect(html).not.toContain("");
expect(html).toContain("for (const step of rest.steps) {");
expect(html).toContain("if (step.request.body) {");
expect(html).toContain('step.request.body = "";');
});
it("preserves every recovered block separated by blank lines", () => {
const html = renderMarkdown(`- **first block**
[second block](https://example.com)`);
expect(html).toContain("first block");
expect(html).toContain('second block');
expect(
renderMarkdown(
"- Read [the guide][guide].\n\n [guide]: /local\n\n[guide]: /document",
),
).toContain('the guide');
expect(renderMarkdown("- first\n\n ```\n \tcode\n ```")).toContain(
"\tcode\n
",
);
});
it("recursively normalizes lists in recovered tail blocks", () => {
const html = renderMarkdown(`- first block
- nested block`);
expect(html).not.toContain("");
expect(html).toContain("nested block");
});
it("preserves fenced code blocks within list items", () => {
const html = renderMarkdown(`- \`\`\`ts
const value = 1;
\`\`\``);
expect(html).toContain('const value = 1;');
});
it("preserves indented code blocks that start below a list marker", () => {
const html = renderMarkdown(`-
const value = 1;`);
expect(html).toContain("const value = 1;");
});
});