Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working when using in mdx-js/mdx #7

Open
HJZzzzz opened this issue Jun 6, 2023 · 2 comments
Open

Not working when using in mdx-js/mdx #7

HJZzzzz opened this issue Jun 6, 2023 · 2 comments

Comments

@HJZzzzz
Copy link

HJZzzzz commented Jun 6, 2023

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;
}
});
};
},
],
});

@alvinometric
Copy link
Owner

Where are you using this? I'm not sure why you need (await import('remark-remove-comments')).default ?

@HJZzzzz
Copy link
Author

HJZzzzz commented Jun 30, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants