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

Improvement: GitHub compatible heading links #267

Closed
alek13 opened this issue Oct 2, 2017 · 2 comments
Closed

Improvement: GitHub compatible heading links #267

alek13 opened this issue Oct 2, 2017 · 2 comments

Comments

@alek13
Copy link
Contributor

alek13 commented Oct 2, 2017

Thank you for this beautiful tool!
I want to offer some improvement for compatibility heading links with GitHub's ones.

GitHub way:
Heading links anchor have no .toLowerCase() transform.
So, if you open this page, you see generated 'Минимальная настройка' heading url with hash, that have first letter in Upper case.
So, in any pages I can use this in this format quick.md#Минимальная настройка. For example, I use this in top of the same page, where I get something like ToC. This works on GitHub, but not works on generated Docsify's pages.

Docsify way
Heading links anchor have .toLowerCase() transform.
So, on this page you can see, that generated heading link anchor have first letter in lower case.
So, if you scroll to top of page, you see, that link does not works.

Try workaround
If change link in ToC to lewercased first letter, it works on Docsify, but not works on GitHub.

Possible solution
I think its enough just to delete this line: https://github.com/QingWei-Li/docsify/blob/master/src/core/render/slugify.js#L8
or maybe somewhere more,
or maybe you want to implement an option.

Or! just write some documentation how to do this.

@alek13 alek13 changed the title Improvement: GitHub compatible headig links Improvement: GitHub compatible heading links Oct 2, 2017
@alek13
Copy link
Contributor Author

alek13 commented Oct 2, 2017

Sorry, one detail:
This happens only if heading not in English.
If heading have English language like here, GitHub also transform toLowerCase.

@alek13
Copy link
Contributor Author

alek13 commented Oct 2, 2017

Thank you!!! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants