Skip to content

Improvement: GitHub compatible heading links #267

Closed
@alek13

Description

@alek13

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions