Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown file name with the ? suffix. #1856

Open
1 task done
Koooooo-7 opened this issue Aug 12, 2022 · 1 comment
Open
1 task done

Markdown file name with the ? suffix. #1856

Koooooo-7 opened this issue Aug 12, 2022 · 1 comment

Comments

@Koooooo-7
Copy link
Member

Bug Report

Steps to reproduce

Based on the official doc, made a file name deploy?.md.
Add route in sidebar.

- Guide

  - [Deploy?](deploy?.md)

What is current behaviour

The path changes to /deploy without ?. and get 404 back.

What is the expected behaviour

Should find the right path to load file.

Other relevant information

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

  • Your OS: macOS monterey.

  • Node.js version:

  • npm/yarn version:

  • Browser version:

  • Docsify version: latest

  • Docsify plugins:

Please create a reproducible sandbox

Edit 307qqv236

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

@Koooooo-7
Copy link
Member Author

Koooooo-7 commented Aug 12, 2022

FYI. On hash mode. We slice the ? and thought it should have the parameters, but the query is empty.

path = path.slice(0, queryIndex);

    const queryIndex = path.indexOf('?');
    if (queryIndex >= 0) {
      query = path.slice(queryIndex   1);
      path = path.slice(0, queryIndex);
    }

    return {
      path,
      file: this.getFile(path, true),
      query: parseQuery(query),
    };

Beside, the ? will be ignore in URL either, the browser think it is no params with a ?, it seems we should change to ? instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant