import { describe, expect, it } from "vitest"; import { renderAgentConversationCopyHtml } from "./agentConversationCopyHtml"; describe("renderAgentConversationCopyHtml", () => { it("renders headings, paragraphs, lists and GFM tables", () => { const html = renderAgentConversationCopyHtml( [ "# Session title", "", "Hello **world**", "", "- item one", "- item two", "", "| a | b |", "| - | - |", "| 1 | 2 |" ].join("\n") ); expect(html).toContain("

Session title

"); expect(html).toContain("world"); expect(html).toContain("
  • item one
  • "); expect(html).toContain(""); expect(html).toContain(""); }); it("keeps inline data-URI images as real img sources", () => { const html = renderAgentConversationCopyHtml( "![shot.png]()" ); expect(html).toContain( 'shot.png { const html = renderAgentConversationCopyHtml( [ "", "", "[link](javascript:alert(1))", "", "![x]()" ].join("\n") ); expect(html).not.toContain("
    1