Closed brillout closed 3 years ago
An interesting idea, and one which the community may be interested in!
Markdown and MDX are aware there is a code block, but they don't parse the language/content inside the block. This is not something which would make sense in MDX core.
That said, what you want could/would be possible with a plugin. Similar to how syntax highlighting can be added to codeblocks https://mdxjs.com/guides/syntax-highlighting You could create a plugin/component to parse JavaScript codeblocks, find the comments, and check the comments with a markdown parser to highlight or link the way you want.
You can find an intro to working with syntax trees and plugins at https://unifiedjs.com/learn and if you have questions on creating plugins https://github.com/mdx-js/mdx/discussions is here to help.
That would be so sweet...
While inline codes are a nice to have, URLs in comments are actually quite common.