Skip to content

Have a BUG in scroll.js #1127

Description

@vagra

Bug Report

Steps to reproduce

have a BUG in scroll.js

this BUG cause:

if path and id include chinese character, it can't find some result from the nav[].

What is current behaviour

export function scrollIntoView(path, id) {
if (!id) {
return;
}
const topMargin = config().topMargin;
const section = dom.find('#' + id);
section && scrollTo(section, topMargin);
const li = nav[getNavKey(path, id)];

What is the expected behaviour

last line shoule changed to:

 const li = nav[getNavKey(decodeURIComponent(path), decodeURIComponent(id))];

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS:

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version:

  • Docsify plugins:

Please create a reproducible sandbox

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions