import { describe, expect, it } from "vitest"; import { markdownToMatrixHtml } from "./format.js"; describe("markdownToMatrixHtml", () => { it("renders basic inline formatting", () => { const html = markdownToMatrixHtml("hi _there_ **boss** `code`"); expect(html).toContain("there"); expect(html).toContain("boss"); expect(html).toContain("code"); }); it("renders links as HTML", () => { const html = markdownToMatrixHtml("see [docs](https://example.com)"); expect(html).toContain('docs'); }); it("escapes raw HTML", () => { const html = markdownToMatrixHtml("nope"); expect(html).toContain("<b>nope</b>"); expect(html).not.toContain("nope"); }); it("flattens images into alt text", () => { const html = markdownToMatrixHtml("![alt](https://example.com/img.png)"); expect(html).toContain("alt"); expect(html).not.toContain(" { const html = markdownToMatrixHtml("line1\nline2"); expect(html).toContain("