hexo-toc seems to disable "Automatic Headline ID's" feature of hexo-renderer-markdown-itSee original GitHub issue
I’m using hexo with hexo-renderer-markdown-it plugin to get a better markdown renderer.
I also use hexo-toc to get tocs on my posts.
When I’m using both of them, the Automatic Headline ID’s feature does not work as expected.
I expect each header to be rendered as:
<h3 id="create-a-new-post"><a class="header-anchor" href="#create-a-new-post">¶</a>Create a new post</h3>
and headers are rendered as:
<h3><span id="create-a-new-post">Create a new post</span></h3>
I can make further tests, but I need help to find out where does this behaviour comes from.
- Created 6 years ago
Top GitHub Comments
It works with the following config
## Docs: https://github.com/celsomiranda/hexo-renderer-markdown-it/wiki/ markdown: render: linkify: true html: true anchors: level: 1 # Minimum level for ID creation. (Ex. h2 to h6) collisionSuffix: 'v' # A suffix that is prepended to the number given if the ID is repeated permalink: false # If `true`, creates an anchor tag with a permalink besides the heading permalinkClass: header-anchor # Class used for the permalink anchor tag permalinkSymbol: '¶' # The symbol used to make the permalink # TOC config ## https://github.com/bubkoo/hexo-toc toc: maxdepth: 6 class: toc anchor: position: after symbol: '¶' style: header-anchor
<h2><span id="team">Team</span><a href="#team" class="header-anchor">¶</a></h2>
You can’t have both
As there is no answer from this repo maintainer and as this repo seems to be not maintained any more, I will try to dive into the code and to fix this bug. Any help is welcomed.
I also tried a workaround (see issue #24) pointed by @noraj but it is just a workaround that require a modification of each theme. Besides, I think that such feature should not rely on the theme, but on the blog engine and plugins.