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
refactor: Backup anchors without hrefs, for compatibility with autorefs' Markdown anchors #651
Conversation
This will be useful for the soon-to-come Markdown anchors feature of mkdocs-autorefs. Related to mkdocs-autorefs#39: mkdocstrings/autorefs#39
I first went with a custom iterator approach (yielding parent, index, element) to insert at the right position, but since it iterated forward and we had to insert at Instead, I used a recursive approach, and at each layer I iterate on elements backwards to be able to insert in the being-iterated elements. The other option was to iterate on a copy of the list of elements, but this would have been less efficient. |
Looks awesome otherwise :) |
OK LGTM! Squashing incoming 🙂 |
This will be useful for the soon-to-come Markdown anchors feature of mkdocs-autorefs.
Related to mkdocs-autorefs#39: mkdocstrings/autorefs#39