-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unexpected characters when applying to md file #493
Comments
Why are you changing the language mode of a markdown file to MDX? This will break several tools. |
We have a Docusaurus project that mostly has I don't think changing the file language in VSCode should break other tools. A file extension doesn't guarantee the actual contents of a file. It's just a hint. Just something I noticed when trying to use the MDX extension on Also, since MDX is (mostly) a superset of MD, it should work mostly fine. |
The MDX compiler can handle both markdown and MDX files into React components. It detects the format based on the file extension. If Docusaurus treats
Changing the language in an editor doesn’t change the build tool.
This is true to some extent. VSCode does treat a file based on the language ID. That’s why, if you change the language of a TypeScript however, doesn’t use these language IDs. TypeScript checking is based on file extensions. The MDX TypeScript plugin treats
This is a good example. I created a file named /**
* @returns {string}
*/
export function example() {
return 42
} Based on hover info and diagnostics, you can see that this is treated as TypeScript, not JavaScript. TypeScript uses the inferred return type instead of the explicit JSDoc return type, and suggests to use a TypeScript type annotation instead of a JSDoc annotation. |
Initial checklist
Affected package
[email protected]
Steps to reproduce
test.md
file in VSCode w/ the MDX extension.Actual behavior
The MDX plugin raises errors about unknown identifiers or other ts-plugin errors.
Expected behavior
The MDX plugin should work on the contents regardless of the file extension
Runtime
No response
Package manager
No response
Operating system
No response
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: