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
Crop large anchor ID's #167
Comments
That would make it more difficult for a human to link to a section though... |
I'm not saying the hash becomes the anchor. I'm saying the anchor is the name of the header (just the one its linking to, not its parents) and a hash is appended to ensure it's unique. |
It appears github just uses the title of the (sub)heading and appends an index to it when there are possible conflicts. For instance, if there are two sections called
Does that seem like a reasonable approach? |
Also see gollum/gollum#1261 |
Do not include ancestry in anchors. Resolves #167
Fixed in |
This is an example of a generated anchor ID on the wiki I'm working on:
Manual/prefs#preferences_editor-preferences_smart-editing_configuring-word-or-character-wrap
It's veeery long, too long. Could this be handled more intelligently? eg. it seems to be including all parent headers in the anchor, this seems unnecessary. Additionally it would be nice if we could force a max length for these anchors, and have it crop if the max length is reached.
I understand the main reason for this is to ensure the anchor is unique, but you could also generate a hash based on the current information used and append this.
Far as I'm aware these hashes don't affect SEO, so there should be no concerns there.
The text was updated successfully, but these errors were encountered: