-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add MDX language #6339
Add MDX language #6339
Conversation
Yup. The new search still in beta and I'd rather keep things simple for now, especially as the new search does give a clue on how to correct things if you use the old syntax. The template will be changed when it becomes the default search for all users. |
Good point! ID added. Ah, it’s still in beta, I forgot that I toggled it on! I have some further Qs btw, hoping someone can help me!
|
MDX is a literate programming language that combines markdown with several JavaScript language features, such as JSX, expressions, and ESM. * markdown: <https://commonmark.org/> * JavaScript: <https://tc39.es/ecma262/> * JSX: <https://facebook.github.io/jsx/> Previously, there was some temporary duct-tape in place, to map `.mdx` extensions to markdown: github-linguistGH-4416. This improved the situation from nothing to something, but has issues, because the syntax that MDX brings wasn’t highlighted. With this grammar, those can be properly highlighted. Related-to: github-linguistGH-4416.
GitHub uses PCRE for performance reasons, so anything that PCRE supports, GitHub supports. The grammar compiler will flag anything that isn't PCRE compatible and any regex errors. You can see examples of this in #3924
It won't.
Most definitely! We're always on the lookout for actively maintained grammars, especially if they're better than anything else we're using. Feel free to skip the discussion and go straight to submitting a PR. Include examples where your grammar does things better than the current grammar too. |
Hmm, that source seems incorrect: MDX files, since the introduction of
Awesome, will do! |
I've looked into this and it this would be our fault when we merged #4416 😁. Markup uses the language Linguist tells it to and if it matches one of the expected "markups", it'll attempt to render it using the appropriate rendered. Of course, this means when this PR is merged that rendering will disappear. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Note: this PR will not be merged until close to when the next release is made. See here for more details.
Description
MDX is a literate programming language that combines markdown with several JavaScript language features, such as JSX, expressions, and ESM.
Previously, there was some temporary duct-tape in place, to map
.mdx
extensions to markdown: GH-4416.This improved the situation from nothing to something, but has issues, because the syntax that MDX brings wasn’t highlighted.
With this grammar, those can be properly highlighted.
Related-to: GH-4416.
Checklist:
#fcb32c
I have updated the heuristics to distinguish my language from others using the same extension.(not needed?)P.S. the URL in the issue template doesn’t work with the new GH search: