You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The anchor name of a section header such as ## Table 1 has a prefix of user-content- such as user-content-table-1, and so a link to #table-1 doesn't work.
Oh wow, you're absolutely right. GitHub is prefixing the anchor tags with "user-content". I imagine it's so your headers don't interfere with GitHub's anchors. Still, it's kind of hacky.
I threw together a working solution. Namely, I found the part in the GitHub source that scrolls to elements when the hash changes and manually copied that into index.html. I didn't immediately find how it scrolls on page-load though, so I used window.onload for now, leaving some room for improvement. (I just don't want to include heavy dependencies like jQuery until absolutely necessary.)
The anchor name of a section header such as
## Table 1
has a prefix ofuser-content-
such asuser-content-table-1
, and so a link to#table-1
doesn't work.For example,
## Table 1
becomes:GitHub does the same thing, but the links on GitHub work, probably due to some magic GitHub script.
The text was updated successfully, but these errors were encountered: