Skip to content

[Bug report] withBase adding duplicating slash #246

@rikbrowning

Description

@rikbrowning

Bug report

withBase adding two slashes when appending url to base.

Description

I have base set to "/feature/" then when I use $withBase("/test.html"). The resulting URL is "/feature//test.html".

In the old vuepress they seem to strip out the first / https://github.com/vuejs/vuepress/blob/38e98634af117f83b6a32c8ff42488d91b66f663/packages/%40vuepress/core/lib/client/app.js#L55

Environment info

  • Output of vuepress info:
 System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 599.88 MB / 7.85 GB
  Binaries:
    Node: 14.15.0 - C:\Program Files\nodejs\node.EXE
    Yarn: Not Found
    npm: 7.15.0 - C:\Program Files\nodejs\npm.CMD
  Utilities:
    Git: 2.21.0. - C:\Program Files\Git\cmd\git.EXE
  Browsers:
    Chrome: 91.0.4472.124
    Edge: Spartan (44.19041.423.0), Chromium (91.0.864.54)
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.20
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.20
    @vuepress/client:  2.0.0-beta.20
    @vuepress/core:  2.0.0-beta.20
    @vuepress/markdown:  2.0.0-beta.20
    @vuepress/plugin-active-header-links: v2.0.0-beta.20 => 2.0.0-beta.20
    @vuepress/plugin-back-to-top:  2.0.0-beta.20
    @vuepress/plugin-container: v2.0.0-beta.20 => 2.0.0-beta.20
    @vuepress/plugin-debug: Not Found
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-git:  2.0.0-beta.20
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.20
    @vuepress/plugin-nprogress:  2.0.0-beta.20
    @vuepress/plugin-palette:  2.0.0-beta.20
    @vuepress/plugin-prismjs: v2.0.0-beta.20 => 2.0.0-beta.20
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: v2.0.0-beta.20 => 2.0.0-beta.20
    @vuepress/plugin-search: v2.0.0-beta.20 => 2.0.0-beta.20
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.20
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.20
    @vuepress/theme-default:  2.0.0-beta.20
    @vuepress/utils:  2.0.0-beta.20
    vue: ^3.1.0 => 3.1.2
    vue-loader: Not Found
    vue-router: ^4.0.0 => 4.0.10
    vuepress: Not Found
    vuepress-vite: ^2.0.0-beta.20 => 2.0.0-beta.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions