-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Issues with providing highlighted lines #20
Comments
Yes, the issue is highlighted here as well: #18
I think it is best to use that work around and wait for |
Ah perfect, then it's best to wait for it. For everyone else having the issue now the workaround above should be sufficient. Feel free to close this issue once it's mentioned in the readme. |
Updated readme with the workaround. |
Take a look at an example of using the plugin with mdx-bundler over here - https://github.com/timlrx/tailwind-nextjs-starter-blog/blob/master/lib/mdx.js#L85 Here is an example with showLineNumbers. No, I do not have a migration guide but the code above should give you a good idea of what's needed to get mdx-bundler working. |
@timlrx Got it working, thanks so much! |
hi @timlrx , This is a great rehype plugins. I want to do it like so `\`\`ts filename="@/store/atom.ts"
import { atom } from 'jotai'
const foodsAtom = useAtom(["Banana", "Apple"])
`\`\` but in my |
Hi @rizkimcitra , i just commenting to share my solution if you haven't solved it yet. I am also using I suggest you try using Below is an example of some of the code I applied. import rehypeMdxCodeProps from "rehype-mdx-code-props";
serialize(source.trim(), {
parseFrontmatter: true,
mdxOptions: {
remarkPlugins: [remarkGfm, remarkBreaks],
rehypePlugins: [
rehypeSlug,
rehypePrism,
[rehypeAutolinkHeadings, { properties: { className: ["anchor"] } }],
rehypeMdxCodeProps,
],
format: "mdx",
development: process.env.NODE_ENV !== "production",
},
}); Note that Additionally, if you get a Hope this helps you solve your problem :) Hi @timlrx , I commented on an issue that has already been resolved, I just wanted to make helpful. I apologize if it was intrusive.
|
I have trouble to use the highlighted lines and
showLineNumbers
feature.In general the line numbers work, if I force
showLineNumbers
on plugin creation. I'm usingnext-mdx-remote
.I played around a little bit and build myself a small plugin that prints the HAST before
rehype-prism-plus
is executed. I'm not a rehype or remark expert at all! This is what my HAST looks like:The issue seems to be, that a property called
data
is expected that should contain themeta
, but instead I have ametastring
property as part ofproperties
.I have no idea if that problem is on my side, or incompatible packages, or if we should just fix it here (by supporting both).
For now I solve this using a plugin on my side, that I run before this plugin:
The text was updated successfully, but these errors were encountered: