-
Notifications
You must be signed in to change notification settings - Fork 15
fix: extract sections within custom components for TOC #1227
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: extract sections within custom components for TOC #1227
Conversation
__tests__/plugins/toc.test.tsx
Outdated
| parentModule.toc.push({ | ||
| type: 'mdxJsxFlowElement', | ||
| name: 'ChildInfo', | ||
| attributes: [], | ||
| children: [], | ||
| } as IndexableElements); |
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.
Why are you modifying the toc tree directly?
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.
I did this to kind of simulate the run-time behaviour so we can make sure nested component TOCs bubble up exactly the way they do in production. (Im not too familiar with the testing patterns of this repo though, so if theres a better pattern I can implement, pls lmk)
## Version 11.7.0 ### ✨ New & Improved * migrate contents inside comments ([#1229](#1229)) ([60691dc](60691dc)) ### 🛠 Fixes & Updates * **deps:** bump tailwindcss from 4.1.16 to 4.1.17 ([#1231](#1231)) ([96343ae](96343ae)), closes [#19263](https://github.com/readmeio/markdown/issues/19263) [#19242](https://github.com/readmeio/markdown/issues/19242) [#19263](https://github.com/readmeio/markdown/issues/19263) [#19242](https://github.com/readmeio/markdown/issues/19242) [#19272](https://github.com/readmeio/markdown/issues/19272) [#19263](https://github.com/readmeio/markdown/issues/19263) [#19238](https://github.com/readmeio/markdown/issues/19238) * empty callouts erroring out ([#1232](#1232)) ([e740bfc](e740bfc)) * extract sections within custom components for TOC ([#1227](#1227)) ([615fe1b](615fe1b)) * skip wrapping heading in callouts for non pragraph ([#1230](#1230)) ([bcb0c0a](bcb0c0a)) * **deps-dev:** upgrading to vitest v4 ([#1222](#1222)) ([4fbaa3e](4fbaa3e)) <!--SKIP CI-->
This PR was released!🚀 Changes included in v11.7.0 |

🧰 Changes
Sections within custom components are now properly extracted and displayed in the table of contents.
🧬 QA & Testing
Demo
Before
before.mov
After
after.mov