4d37be0fb8
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 ![2016-11-21-13.00.28](/uploads/e3be2cd6a9142dfd6e64db5462a6aa76/2016-11-21-13.00.28.gif) ## After: ![2016-11-21-13.12.45](/uploads/f7ae3f3a30c91325eaa3665591b6a850/2016-11-21-13.12.45.gif) ![2016-11-21-13.03.00](/uploads/3a6a782c081ecaa05b8781548d794909/2016-11-21-13.03.00.gif) ## 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 |
||
---|---|---|
.. | ||
api | ||
banzai | ||
cycle_analytics_helpers | ||
features | ||
gitlab_stubs | ||
import_export | ||
matchers | ||
services | ||
api_helpers.rb | ||
capybara.rb | ||
capybara_helpers.rb | ||
carrierwave.rb | ||
cycle_analytics_helpers.rb | ||
database_connection_helpers.rb | ||
db_cleaner.rb | ||
email_format_shared_examples.rb | ||
email_helpers.rb | ||
factory_girl.rb | ||
fake_u2f_device.rb | ||
filter_spec_helper.rb | ||
fixture_helpers.rb | ||
git_helpers.rb | ||
git_http_helpers.rb | ||
import_spec_helper.rb | ||
issue_helpers.rb | ||
issue_tracker_service_shared_example.rb | ||
javascript_fixtures_helpers.rb | ||
jira_service_helper.rb | ||
ldap_helpers.rb | ||
login_helpers.rb | ||
markdown_feature.rb | ||
mentionable_shared_examples.rb | ||
merge_request_helpers.rb | ||
notify_shared_examples.rb | ||
omni_auth.rb | ||
project_features_apply_to_issuables_shared_examples.rb | ||
project_hook_data_shared_example.rb | ||
rake_helpers.rb | ||
reference_parser_helpers.rb | ||
reference_parser_shared_examples.rb | ||
repo_helpers.rb | ||
search_helpers.rb | ||
select2_helper.rb | ||
services_shared_context.rb | ||
setup_builds_storage.rb | ||
slash_commands_helpers.rb | ||
snippets_shared_examples.rb | ||
stub_configuration.rb | ||
stub_gitlab_calls.rb | ||
stub_gitlab_data.rb | ||
taskable_shared_examples.rb | ||
test_env.rb | ||
updating_mentions_shared_examples.rb | ||
wait_for_ajax.rb | ||
wait_for_vue_resource.rb | ||
webmock.rb | ||
workhorse_helpers.rb |