You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Placing a table of contents shortcode after a custom container (tip, warning, danger, etc) will cause the table of contents element to render empty with no children.
Reproduction
index.md:
# Test page
::: warning
This will cause the toc to be empty
:::
[[toc]]
## section 1
## section 2
### subsection 2a
## section 3
Expected behavior
The TOC outline should be populated with children but instead it just renders as <nav class="table-of-contents"></nav>
### Additional context
_No response_
### Validations
- [X] Follow our [Code of Conduct](https://vuejs.org/about/coc.html)
- [X] Read the [docs](https://vitepress.vuejs.org).
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
The text was updated successfully, but these errors were encountered:
Oh I know the reason. The headers are collected inside the toc-plugin, and calling md.renderInline will override the previously collected headers before they are rendered 🤦♂️
meteorlxy
added a commit
to meteorlxy/vitepress
that referenced
this issue
Aug 18, 2022
Describe the bug
Placing a table of contents shortcode after a custom container (tip, warning, danger, etc) will cause the table of contents element to render empty with no children.
Reproduction
index.md:
Expected behavior
The TOC outline should be populated with children but instead it just renders as
<nav class="table-of-contents"></nav>
System Info
The text was updated successfully, but these errors were encountered: