Skip to content
GitLab
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
  • !14740

Let ScrollSpy support uri encoded hash fragments

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/yuku/scrollspy-decode-hash into master Oct 07, 2014
  • Overview 0
  • Commits 3
  • Pipelines 0
  • Changes 2

Created by: yuku

The updated line threw a syntax error when an encoded fragment is given.

href = encodeURIComponent('#テスト')
$(href)
// Error: Syntax error, unrecognized expression: %23%E3%83%86%E3%82%B9%E3%83%88

And browsers (at least Chrome 37.0.2062.124 and Firefox 32.0.3) automatically encodes a[href] values due to rfc3986:

<!-- server response -->
<a href="#テスト"></a>
<div id="テスト"></div>

<!-- browser recognizes as -->
<a href="#%23%E3%83%86%E3%82%B9%E3%83%88"></a>
<div id="テスト"></div>

This means that there is no way to use the plugin with non-ascii hash fragments. This PR fixes the problem.

Patched script works fine on my pages, however, I'm afraid of breaking something important because I'm not familiar with such encoding problems 😨
Thanks.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/yuku/scrollspy-decode-hash