import { describe, expect, test } from "vitest"; import { processTokensSync } from "./marked"; function renderHtml(md: string): string { const tokens = processTokensSync(md, []); const textToken = tokens.find((token) => token.type === "text"); if (!textToken || textToken.type !== "text") return ""; return typeof textToken.html === "string" ? textToken.html : ""; } describe("marked basic rendering", () => { test("renders bold text", () => { const html = renderHtml("**bold**"); expect(html).toContain("bold"); }); test("renders links", () => { const html = renderHtml("[link](https://example.com)"); expect(html).toContain('"); }); test("renders paragraphs", () => { const html = renderHtml("hello world"); expect(html).toContain("

hello world

"); }); }); describe("marked image renderer", () => { test("renders video extensions as