unified plugin
import { rehypeCustomCode } from "rehype-custom-code";
const md = `
\`\`\`javascript title="Hello, World!" {1-5}
console.log("Hello, World!");
\`\`\`
`;
const html = await unified()
.use(remarkParse)
.use(remarkRehype)
.use(rehypeCustomCode, {
shiki: {
themes: {
light: "github-light",
dark: "one-dark-pro",
},
},
})
.use(rehypeStringify)
.process(md);
console.log(html.toString());
rehype plugin to customize code blocks.