This plugin is not working with 'compile' in mdx-js/mdx, but okay when using it with remark.
any idea?
const jsxCode = await compileMdx(mdxWithFakeImports, {
development: false,
remarkPlugins: [
...remarkPlugins,
(await import('remark-remove-comments')).default,
(
await import('remark-gfm')
).default, //remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).
(await import('remark-frontmatter')).default,
],
rehypePlugins: [
// Support stuff like ```js App.js {1-5} active by passing it through.
function rehypeMetaAsAttributes() {
return (tree) => {
visit(tree, 'element', (node) => {
if (node.tagName === 'code' && node.data && node.data.meta) {
node.properties.meta = node.data.meta;
}
});
};
},
],
});
This plugin is not working with 'compile' in mdx-js/mdx, but okay when using it with remark.
any idea?
const jsxCode = await compileMdx(mdxWithFakeImports, {
development: false,
remarkPlugins: [
...remarkPlugins,
(await import('remark-remove-comments')).default,
(
await import('remark-gfm')
).default, //remark plugin to support GFM (autolink literals, footnotes, strikethrough, tables, tasklists).
(await import('remark-frontmatter')).default,
],
rehypePlugins: [
// Support stuff like ```js App.js {1-5} active by passing it through.
function rehypeMetaAsAttributes() {
return (tree) => {
visit(tree, 'element', (node) => {
if (node.tagName === 'code' && node.data && node.data.meta) {
node.properties.meta = node.data.meta;
}
});
};
},
],
});