deno.land / x / lume@v2.1.4 / tests / markdown.test.ts

markdown.test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { assertSiteSnapshot, build, getSite } from "./utils.ts";import footnotePlugin from "npm:markdown-it-footnote@3.0.3";
Deno.test("Build a markdown site", async (t) => { const site = getSite({ src: "markdown", location: new URL("https://example.com/blog"), }, { markdown: { plugins: [footnotePlugin], keepDefaultPlugins: true, rules: { footnote_block_open: () => ( '<h4 class="mt-3">Footnotes</h4>\n' + '<section class="footnotes">\n' + '<ol class="footnotes-list">\n' ), }, }, });
await build(site); await assertSiteSnapshot(t, site);});
Deno.test("Build a markdown with hooks", async (t) => { const site = getSite({ src: "markdown", location: new URL("https://example.com/blog"), });
site.hooks.addMarkdownItPlugin(footnotePlugin); site.hooks.addMarkdownItRule("footnote_block_open", () => ( '<h4 class="mt-3">Footnotes</h4>\n' + '<section class="footnotes">\n' + '<ol class="footnotes-list">\n' ));
await build(site); await assertSiteSnapshot(t, site);});
lume

Version Info

Tagged at
7 months ago