-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Markdown anchors should not have user-content-
prefix in href
#11896
Comments
silverwind
added a commit
to silverwind/gitea
that referenced
this issue
Jun 26, 2020
This changes the links on headings like '# Usage' in markdown from `https://host/user/repo#user-content-usage` to just `https://host/user/repo#usage` matching GitHub and GitLab. The linked id elements still have the prefix and this behaviour matches GitHub and GitLab too, so JS is needed to scroll to the active anchor. I suspect it's like that to avoid namespace collission between user-generated content and other page content. Compatibilty for old links is included so they will continue to work. Also included are some enhancements to make the clickable area for the link icon larger and fix its color on arc-green. Fixes: go-gitea#11896 Fixes: go-gitea#12062
lunny
pushed a commit
that referenced
this issue
Jun 26, 2020
This changes the links on headings like '# Usage' in markdown from `https://host/user/repo#user-content-usage` to just `https://host/user/repo#usage` matching GitHub and GitLab. The linked id elements still have the prefix and this behaviour matches GitHub and GitLab too, so JS is needed to scroll to the active anchor. I suspect it's like that to avoid namespace collission between user-generated content and other page content. Compatibilty for old links is included so they will continue to work. Also included are some enhancements to make the clickable area for the link icon larger and fix its color on arc-green. Fixes: #11896 Fixes: #12062
ydelafollye
pushed a commit
to ydelafollye/gitea
that referenced
this issue
Jul 31, 2020
This changes the links on headings like '# Usage' in markdown from `https://host/user/repo#user-content-usage` to just `https://host/user/repo#usage` matching GitHub and GitLab. The linked id elements still have the prefix and this behaviour matches GitHub and GitLab too, so JS is needed to scroll to the active anchor. I suspect it's like that to avoid namespace collission between user-generated content and other page content. Compatibilty for old links is included so they will continue to work. Also included are some enhancements to make the clickable area for the link icon larger and fix its color on arc-green. Fixes: go-gitea#11896 Fixes: go-gitea#12062
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
A heading like
# Usage
generates a anchoruser-content-usage-example
with same href which is rather ugly in shared links:GitHub and GitLab both do:
I think we should follow and also omit the
user-content
prefix inhref
. This could be a breaking change, but I think we could maybe support both cases to not break existing links.The text was updated successfully, but these errors were encountered: