-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
fix(mdx-loader): support nested admonitions #8303
Conversation
✅ [V2]
To edit notification comments on pull requests, go to your Netlify site settings. |
⚡️ Lighthouse report for the deploy preview of this PR
|
Hey Thanks for the PR As part of the migration to MDX 2.0 (WIP - #8288) we will likely replace all this code with remark-directive so I'm not sure we are going to merge this PR for now. I'll keep it open but the goal is to get rid of the code. I guess it should be possible to support nested admonitions with the remark plugin. |
I think it's still a valuable fix to get into 2.x? I won't anticipate 3.0 to ship in a few weeks, not to mention its wide adoption. |
We'll see. I'd like to see how to implement this in 3.x / MDX 2 before adding such new feature. In case it's complex or impossible to implement in 3.x, I'd rather not introduce a new feature to remove it later, nor to block / delay 3.x because of this new feature. Let's keep this open and see how we can have it both in 2.x and 3.x |
As part of #8288 we want to use the more flexible and generic remark-directive system to provide such features. The nesting is possible, but works similarly to code blocks by adding more : for parent elements. Here's a preview: :::::note{title="Your title"}
Some **content** with _Markdown_ `syntax`.
::::note[Your nested Title]
:::note Your very nested Title (does not work yet :s)
Some **content** with _Markdown_ `syntax`.
:::
Some **content** with _Markdown_ `syntax`.
::::
hey
::::: If we add this feature in v2 I'd rather have the exact same syntax instead of always using That way users do not have to change anything when upgrading and there's no extra breaking change to explain. Can you update the code to support 4/5+ colons please? |
Thanks for the review and the suggestions. I changed the algorithm which keeps track of the nesting level. Now it handles nested admonitions the way remark-directive does, e.g. with 4/5/+ colons... |
LGTM thanks 👍 |
Pre-flight checklist
Motivation
See #8302 - support nested admonitions
Test Plan
Test links
Related issues/PRs
#8302