Fixes #100 implements a custom Markdown renderer

This commit is contained in:
Zef Hemel
2022-11-01 15:01:28 +01:00
parent b8e27b216e
commit 3d671e8195
20 changed files with 652 additions and 37 deletions
+29
View File
@@ -0,0 +1,29 @@
import { assertEquals } from "https://deno.land/std@0.152.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>`,
);
});