1
0
silverbullet/plugs/markdown/html_render.test.ts

30 lines
575 B
TypeScript
Raw Normal View History

2022-11-19 15:05:37 +00:00
import { assertEquals } from "https://deno.land/std@0.165.0/testing/asserts.ts";
import { renderHtml } from "./html_render.ts";
Deno.test("HTML Render", () => {
assertEquals(
renderHtml({
name: "b",
body: "hello",
}),
`<b>hello</b>`,
);
assertEquals(
renderHtml({
name: "a",
attrs: {
href: "https://example.com",
},
body: "hello",
}),
`<a href="https://example.com">hello</a>`,
);
assertEquals(
renderHtml({
name: "span",
body: "<>",
}),
`<span>&lt;&gt;</span>`,
);
});