Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !4801

Allow ScrollSpy to match non-latin anchors

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/scomma/patch-1 into master 12 years ago
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: scomma

Currently it's using \w to test link validity. ScrollSpy shouldn't be in the business of specifying which anchors are valid or not. In this case anchors like #^_^ or #香港 will fail even though browser recognizes them just fine.

Compare
  • master (base)

and
  • latest version
    5146e961
    1 commit, 2 years ago

1 file
+ 1
- 1

    Preferences

    File browser
    Compare changes
js/bootstrap-scrollspy.js
+ 1
- 1
  • View file @ 5146e961


@@ -56,7 +56,7 @@
.map(function () {
var $el = $(this)
, href = $el.data('target') || $el.attr('href')
, $href = /^#\w/.test(href) && $(href)
, $href = /^#.+/.test(href) && $(href)
return ( $href
&& $href.length
&& [[ $href.position().top, href ]] ) || null
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
1
js
1
js
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: twbs/bootstrap!4801
Source branch: github/fork/scomma/patch-1

Menu

Explore Projects Groups Snippets