MCPcopy
hub / github.com/11ty/buildawesome / createTestMarkdownPlugin

Function createTestMarkdownPlugin

test/TemplateRenderMarkdownPluginTest.js:21–32  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19}
20
21const createTestMarkdownPlugin = () => {
22 const plugin = (md) => {
23 md.core.ruler.after("inline", "replace-link", function (state) {
24 plugin.environment = state.env;
25 const link = state.tokens[1].children[0].attrs[0][1];
26 state.tokens[1].children[0].attrs[0][1] = `${link}?data=${state.env.some}`;
27 return false;
28 });
29 };
30 plugin.environment = {};
31 return plugin;
32};
33
34test("Markdown Render: with HTML prerender, sends context data to the markdown library", async (t) => {
35 let tr = await getNewTemplateRender("md");

Calls

no outgoing calls

Tested by

no test coverage detected