Skip to content
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

Add anchorAlias option and fix heading id collisions #60

Closed
wants to merge 5 commits into from

Conversation

@mdluo
Copy link

mdluo commented Apr 8, 2018

Read more in Chinese about this PR.

1. Add an anchorAlias option (false by default) to let user to use href as anchor ID alias.

E.g. Markdown source code:

## [Anchor](#alias)

will become the following html code if the anchorAlias is set to true:

<h2 id="alias"><a href="#alias">Anchor</a></h2>

2. Fix heading id collisions.

E.g.

## example
## example
## example-1

3. Update README and add comment of the new option.

4. Add testing code for the new option and the fix. The coverage is 100% for the modified code.

mdluo added 3 commits Feb 10, 2018
- Fixed heading id collision
- Add anchorAlias option
- Add test code
- Update README.md
@coveralls

This comment has been minimized.

Copy link

coveralls commented Apr 8, 2018

Coverage Status

Coverage increased (+2.9%) to 90.164% when pulling a7859e9 on mdluo:master into 944fa64 on hexojs:master.

mdluo and others added 2 commits Apr 9, 2018
@curbengh

This comment has been minimized.

Copy link
Contributor

curbengh commented Dec 6, 2019

  1. Implemented, albeit with two <a>
## [hexo-server](https://github.com/hexojs/hexo-server)
<h2 id="hexo-server"><a href="#hexo-server" class="headerlink" title="hexo-server"></a>
<a href="https://github.com/hexojs/hexo-server">hexo-server</a></h2>

The last <a> take precedent.

  1. Implemented, but collisionSuffix: option (found in hexo-renderer-markdown-it) is not implemented yet.
@curbengh curbengh closed this in #126 Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.