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

sidebar.md 配置的相对路径 query 参数在请求时没有带上 #303

Closed
linkgod opened this issue Nov 6, 2017 · 1 comment
Closed

Comments

@linkgod
Copy link

linkgod commented Nov 6, 2017

Hello, QingWei

我发现一个小BUG,并且定位到了问题代码的位置:

https://github.com/QingWei-Li/docsify/blob/master/src/core/fetch/index.js#L20

proto._fetch = function (cb = noop) {
  const { path } = this.route
          ^
  const { loadNavbar, loadSidebar } = this.config

  // Abort last request
  last && last.abort && last.abort()

  last = get(this.router.getFile(path), true)
         ^
  ...
}

这里的 this.route 是有 query 参数的,但是在 get 的时候只请求了 path,没有把 query 参数带上

场景描述

因为我使用文件服务器会自动将 README.md 渲染为HTML,所以必须在请求时附带参数 type=raw 让服务器返回源文件。

但是我发现,当页面地址是 http://localhost:3000/index.html#/../src/expandable-text/?type=raw 的时候

docsify 请求的是 http://localhost:3000/src/expandable-text/README.md 而不是 http://localhost:3000/src/expandable-text/README.md?type=raw

这导致我的文档显示有一点异常,希望你可以帮忙处理一下这个小问题,十分感激

@linkgod
Copy link
Author

linkgod commented Nov 9, 2017

感谢

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

No branches or pull requests

2 participants