User-generated permalink IDs collide with GitLab interface
The ID values automatically generated by headers in GitLab Flavored Markdown are not namespaced and can end up being the same as the IDs used elsewhere in the GitLab interface. This can cause confusion when, for instance, a selector looks for a merge request tab with
id="pipelines" and there is a header with the same ID earlier in the DOM. (see @brycepj's comment below)
- add a namespace to all user-generated IDs (
window.location.hashon load, test whether the ID exists, and if not look for the same ID prepended with
user-content-. and scroll to that position if found
- keep all anchor links non-namespaced, so user-generated anchors still look like
If you visit !5998 (merged) you should notice that the
Pipelines tabs don't load the build/pipeline partials. It seems as though they're not even trying to start loading them. There are no errors thrown in the console so maybe there is a conditional causing this to silently fail.
Notice that the tab get selected, but whatever partial is current active will stay there.
This doesn't seem to be across all MRs.
Pro tip: This MR has very long description because of images so visit this anchor link if you want to skip down to the tabs area.