-
- Downloads
There was a problem fetching the pipeline summary.
Merge branch '22781-user-generated-permalinks' into 'master'
Resolve "User-generated permalink IDs collide with GitLab interface" ## What does this MR do? Prevents ID values automatically generated by headers in [GitLab Flavored Markdown](https://github.com/gitlabhq/gitlabhq/blob/master/doc/user/markdown.md#header-ids-and-links) from colliding with 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. How this works: * All header IDs generated with GitLab Flavored Markdown are namespaced with `id="user-content_foo"` * All anchor links which point to these IDs continue to use the non-namespaced hash `<a href="#foo">...</a>` * When a page is loaded or when the `hashchange` event is triggered, javascript will automatically search for `#user-content_foo` if `#foo` cannot be found, and scroll to that position instead. ## Before  ## After:   ## Does this MR meet the acceptance criteria? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - Tests - [x] Added for this feature/bug - [ ] All builds are passing - [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if it does - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #22781 See also prior attempts to address this issue: #3908, !2023, !2024 See merge request !7631
No related branches found
No related tags found
Pipeline #
Showing
- app/assets/javascripts/application.js 5 additions, 26 deletionsapp/assets/javascripts/application.js
- app/assets/javascripts/lib/utils/common_utils.js 29 additions, 4 deletionsapp/assets/javascripts/lib/utils/common_utils.js
- app/assets/stylesheets/framework/typography.scss 1 addition, 0 deletionsapp/assets/stylesheets/framework/typography.scss
- changelogs/unreleased/22781-user-generated-permalinks.yml 4 additions, 0 deletionschangelogs/unreleased/22781-user-generated-permalinks.yml
- doc/development/gotchas.md 0 additions, 48 deletionsdoc/development/gotchas.md
- features/steps/shared/markdown.rb 1 addition, 1 deletionfeatures/steps/shared/markdown.rb
- lib/banzai/filter/table_of_contents_filter.rb 5 additions, 3 deletionslib/banzai/filter/table_of_contents_filter.rb
- spec/lib/banzai/filter/table_of_contents_filter_spec.rb 13 additions, 8 deletionsspec/lib/banzai/filter/table_of_contents_filter_spec.rb
- spec/support/matchers/markdown_matchers.rb 3 additions, 3 deletionsspec/support/matchers/markdown_matchers.rb
Loading
Please register or sign in to comment