Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Headers don't render properly if there is a link in them #16
Some additional details from debugging this...
Line 20 of the renderer,
...with the returned header link result of:
As a proposed solution, what about skipping the header link if an anchor already exists in the string? Something like this as a replacement for line 31:
I'm new to hexo, so I'm unsure what other impacts this may have on other parts of the system (if any).
Also new to hexo here but my suggestion would be to remove the automatic bookmark completely. Or at the very least, make it an option that can be turned on if necessary. I don't see a lot of use for it in the wild so including it "just in case" adds little value.
That's the approach taken by this renderer which I've switched to for now.
Bah, ignore my proposed solution above. I just realized that the header link is not wrapping the text itself. The problem is in the
@kbaley my preference would be to keep the feature (an option to enable/disable would be OK for me). I find being able to share links directly to header sections to be generally helpful. It is annoying when I cannot find an anchor tag on a very long page when I want to share a direct link to a section. It is also being used in conjunction with the table of contents on the hexo docs pages. Just my 2 cents.