import { describe, it, expect } from "vitest";
import { renderMarkdown, renderMarkdownSync, markdownToPlainText } from "./markdown";
describe("Markdown Rendering", () => {
describe("renderMarkdown", () => {
it("should render basic markdown to HTML", async () => {
const markdown = "# Hello World\n\nThis is **bold** text.";
const html = await renderMarkdown(markdown);
expect(html).toContain("
bold");
});
it("should handle empty input", async () => {
const html = await renderMarkdown("");
expect(html).toBe("");
});
it("should handle null/undefined input", async () => {
expect(await renderMarkdown(null as any)).toBe("");
expect(await renderMarkdown(undefined as any)).toBe("");
});
it("should sanitize potentially dangerous HTML", async () => {
const markdown = '\n\n**Safe** content';
const html = await renderMarkdown(markdown);
expect(html).not.toContain("';
const html = renderMarkdownSync(markdown);
expect(html).not.toContain("';
const html = await renderMarkdown(markdown);
expect(html).not.toContain("