Open tats-u opened 1 year ago
This is already addressed in v3. See for example: https://github.com/facebook/docusaurus/pull/8788
It's good to know. Sorry for the lack of a detailed investigation. I was going to look into v3 using my desktop (this issue is written using my cellphone).
v3 will keep supporting the old legacy syntax.
However, your VSCode might still report syntax errors, which can be annoying, because indeed it's not valid in MDX 2 anymore.
A temporary workaround if you want things to work in VSCode + Docusaurus is to use # foo \{#id}
(that's basically what the mdx1 compat layer does, it escapes the expression block)
I think it's worth reopening this issue: the current setup probably doesn't prevent you from upgrading to Docusaurus v3, but we still need to find a solution (new syntax) that works out of the box with MDX 2, and a migration plan for our users. That's better in the long-term, for compatibility with VSCode, Prettier, ESLint, and all other external tools that understand MDX 2.
@wooorm has suggested doing like the new React website, using MDX comments: # foo {/* id */}
There are other implications to consider, like how our recommended translation SaaS Crowdin will understand such syntax once they have better support for MDX (which they are working on). For these reasons, I have delayed that syntax decision.
Hello , can I take a look at this bug ?
Hello , can I take a look at this bug ?
Hello @dejongbaba Docusaurus maintainers don't assign issues or bugs to anyone, if you want to work on this feel free to send directly a PR that fixes the issue / bug
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
(WIP)
vs
The language server in the MDX extension for VS Code show a syntax error on the header syntax. I believe the current syntax using single braces is no longer approved. Double parens
((#id))
is an alternative.Reproducible demo
WIP
Steps to reproduce
Expected behavior
No errors
Actual behavior
Syntax error
Your environment
Operating system and version (e.g. Ubuntu 20.04.2 LTS):
WIP
Self-service