-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
permalink in anchors shouldn't be parsed by TOC helper #102
Comments
I assume you enabled markdown:
anchors:
permalink: true
What is the expected behavior? Show permalink symbol in heading, but not in toc? |
Yeah I enabled
Exactly. I see you confirmed the issue is coming from cheerio (hexojs/hexo-util#174 (comment)). |
Issue / current behavior
Currently permalinks are added as a link inside the title, for example:
This will produce something like:
The problem is the permalink symbol will be part of the title.
So when you use, for example, the
toc
helper, the permalink symbol will be added in the title too.Idea of fixing / workaround
My workaround was to set a null symbol
permalinkSymbol: ''
and to add some css (sass here):So this display the same and is still clickable but there is no more content in the title.
Same look
No more issue with the toc helper
But I think it can't be fixed like this because this plugin only generates html, no css.
Alternative idea
Fix the toc helper to select only text content and not other sub-elements like links.
https://github.com/hexojs/hexo/issues/4057
Environment
Happening with both hexo: 4.2.0 and hexo: 4.1.1
The text was updated successfully, but these errors were encountered: