-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
mdx-code-block
doesn't work when indented
#10220
Comments
No you don't need to. The issue is that you cannot indent your |
mdx-code-block
doesn't workmdx-code-block
doesn't work when indented
So… Is it a bug? |
Yeah I think so. |
This is a bug/limitation yes. Unfortunately we don't really plan to fix it, because it the mdx-code-block thing is a limitation of the current system. The mdx-code-block is a best-effort that will not work in all situations because we don't use a real Markdown parser to "unwrap" the blocks ```mdx-code-block
<Tabs>
<TabItem value="c1" label="下载 Release" default>
``` To support this with a real Markdown parser and support edge cases properly, we would have to write a remark plugin. Unfortunately, writing a remark plugin has limitations too, and what's inside of the code block would have to be valid MDX. Your code block content is not valid MDX, so this "proper solution" would not even handle your case like you'd expect, because this errors: The thing is, you can't parse MDX fragments in "slices", you have to have valid JSX markup. To parse this properly, you would have to write the whole JSX inside the code block, which is not ideal because now there's translatable content appearing inside the code block: ```mdx-code-block
<TabItem value="c1" label="下载 Release" default>
```
1. 从 [Releases](https://github.com/TTB-Network/python-openbmclapi/releases) 中下载代码。
2. 将下载好的源码放到一个事先准备的文件夹。
3. 在文件夹中打开终端。
```mdx-code-block
</TabItem>
``` For these reasons even if the current system is imperfect, I think it is good enough and the right tradeoff for our usage. If nesting is a problem, you can try to isolate the nested mdx-code-block inside a partial |
Hmm, that being said it should be relatively easy to handle nesting in our |
Hey! How can I get the Canary version after this bug is fixed, or can I only wait for the release of the new version? |
Here is the guide on how to use canary versions until the fix is included in the next release : https://docusaurus.io/community/canary |
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
I'm using Crowdin to translate my Docaurus MDX documents. In order to make the text displayed correctly on Crowdin, I added
mdx-code-block
to my document according to the official document to convert the text into a code block.According to my research on some official documents, this is probably because I didn't install
@docausaurus/utils
, but the document does not clearly state that I need to install this package. If possible, please improve the content of this part of the document.Here is my source code:
Reproducible demo
No response
Steps to reproduce
Expected behavior
According to the description of the document, the content of the
mdx-code-block
code block will be automatically recognized as JSX content.Actual behavior
However…
Your environment
Self-service
The text was updated successfully, but these errors were encountered: