-
Notifications
You must be signed in to change notification settings - Fork 103
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
Generate TOC does not respect heading levels. #53
Comments
To make a nested TOC, the buffer-local |
Did this chance with a new recent Emacs version? |
It did; maybe a default value was changed? Although this would be a change in markdown-mode rather than Emacs itself right? |
I tried setting it like this: |
It took a while digging around and this seems related to native compilation as far as I can tell. I have a workaround in my config here: Basically - disable native compilation for markdown-mode & add a hook to enable nested TOC generation. Might help you as well? |
Good idea, but didn't work unfortunately. This is a bummer, as this is a super useful feature for me. |
To be clear - you need to delete any already natively-compiled markdown-mode files or that first part won't be effective. Just make sure you do that... |
I had to restart my emacs, but it worked! Nice callout @sochotnicky |
Hi, replace this funtion will fix it. (defun markdown-toc--compute-toc-structure (imenu-index)
"Given a IMENU-INDEX, compute the TOC structure."
(--mapcat (markdown-toc--compute-toc-structure-from-level
(if (eq markdown-toc-user-toc-structure-manipulation-fn 'cdr)
-1
0)
it)
imenu-index)) |
- fix issuse ardumont#53
bug
Generated TOC does not respect heading levels and every TOC entry is on the same level.
Emacs Doom: master
Emacs Version: 28.1 with native-compilation
Config
With and without it, the issue still occurs.
Expected behavior
Actual behavior
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: