Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/crutchcorn/cli-testing-library. 🐨 Simple and complete CLI testing utilities that encourage good tes cli-testing.com
Something went wrong. Try again.
12345678910111213141516171819202122import { defineHastPlugin } from "satteri";
const markdownExtensionPattern = /^(\..+)\.md(.*)/;
export const satteriHandleMdExtension = defineHastPlugin({ name: "handle-md-extension", element: { filter: ["a"], visit(node, ctx) { const href = node.properties.href;
if (typeof href !== "string") return;
const match = href.match(markdownExtensionPattern);
if (match) { ctx.setProperty(node, "href", `${match[1]}${match[2]}`); } }, },});